Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
JSerのための ブラウザコードリーディング (テスト編)
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Edward Fox
April 28, 2017
Programming
2.5k
3
Share
JSerのための ブラウザコードリーディング (テスト編)
Meguro.es x Gotanda.js #1 in Drecom
https://meguroes.connpass.com/event/49543/
Edward Fox
April 28, 2017
More Decks by Edward Fox
See All by Edward Fox
Priorityを制するものはローディングを制す
edwardkenfox
4
800
Lambda@Edgeを利用したサードパーティJavaScriptのカナリアリリース / Canary release using Lamdba@Edge
edwardkenfox
0
130
AWS re:Invent 2019 / Hackathon for Good 参加録
edwardkenfox
2
620
Repro basketball club
edwardkenfox
0
280
Introduction to UX Optimizer
edwardkenfox
0
140
フロントエンド開発の落とし穴 / Fallacies of Client Side Programming (2019ver)
edwardkenfox
0
360
僕とprototypeとJSONで / Me and prototype down by the JSON
edwardkenfox
0
170
クライアントサイド開発の落とし穴 / Fallacies of Client Side Programming
edwardkenfox
0
510
Beacon API ことはじめ 〜そしてkeepalive fetchへ〜 / Beacon API The Basics
edwardkenfox
0
1.2k
Other Decks in Programming
See All in Programming
Programming with a DJ Controller — not vibe coding
m_seki
3
180
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
620
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
250
HTML-Aware ERB: The Path to Reactive Rendering @ RubyKaigi 2026, Hakodate, Japan
marcoroth
0
290
Angular Signal Forms
debug_mode
0
120
Oxlintとeslint-plugin-react-hooks 明日から始められそう?
t6adev
0
280
SkillがSkillを生む:QA観点出しを自動化した
sontixyou
6
3.5k
Offline should be the norm: building local-first apps with CRDTs & Kotlin Multiplatform
renaudmathieu
0
230
ルールルルルルRubyの中身の予備知識 ── RubyKaigiの前に予習しなイカ?
ydah
1
210
第3木曜LT会 #28
tinykitten
PRO
0
110
t *testing.T は どこからやってくるの?
otakakot
1
710
レガシーPHP転生 〜父がドメインエキスパートだったのでDDD+Claude Codeでチート開発します〜
panda_program
0
1.1k
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
55
9.9k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
770
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.6k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Evolving SEO for Evolving Search Engines
ryanjones
0
180
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
180
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
270
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
130
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
140
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
Transcript
JSerͷͨΊͷ ϒϥβίʔυϦʔσΟϯά ʢςετฤʣ EDWARD FOX @Meguro.es x Gotanda.js #1 2017/04/28
Edward Fox - Developer @ Repro Inc. - RoR, JavaScript,
AWS - Vue.js, HTTP/2, WebAssembly
લճͷMeguro.esͰ ͜ΜͳΛͤͯ͞Β͍· ͨ͠
None
ϒϥβͷΠϯεϖΫλʹ console.logͱೖྗͨ͠༰ ͕࣮ࡍʹදࣔ͞ΕΔ·Ͱ
ࠓճ͏ͪΐ͍ ࣮ફతͳΛ͠·͢
1. ຊ൪ڥͰΤϥʔ͕ى͖ͨ 2. ௐࠪͯ͠શવΘ͔ΒΜ 3. WebKitͷϦϙδτϦͰgrep 4. ςετίʔυʹώοτͨ͠
ςετίʔυΛಡΜͰ͍͘ͱ ৭ʑͱֶͼ͕͋ͬͨͷͰ ͍͔ͭ͘Λհ
WebKitͷιʔείʔυ֓؍
LayoutTests
1. DOM 2. Security 3. Performance #1 4. Performance #2
1. DOM
LayoutTests/dom/level2/core/ setAttributeNS10.html
ظ͢Δಈ࡞: > setAttributeʹෆਖ਼ͳจࣈ ྻΛ͢ͱ InvalidCharacterError͕ ্͕Δ͜ͱ
ϒϥβͰ։͘
SUCCESS!
2. Security
LayoutTests/security/ contentSecurityPolicy/image- with-blob-url-blocked-by-img- src-star.html
ظ͢Δಈ࡞: > ϖʔδʹ”image-src *”ͷ CSPϔομ͕ଘࡏ͢Δ߹ɺ blob URLΛ௨ͯ͡࡞͞Εͨ ը૾ͷಡΈࠐΈ͕ ϒϩοΫ͞ΕΔ͜ͱ
ϒϥβͰ։͘
PASS!
3. Performance #1
LayoutTests/perf/array-nested- loop.html
ظ͢Δಈ࡞: > ωετ͞Εͨྻͷ ܁Γฦ͠ॲཧͷ࣌ؒܭࢉྔ͕ O(n^2)Ͱ૿Ճ͢Δ͜ͱ
magnitude iterations 2 112352 4 52595 8 118454 16 75968
32 27994 64 7237 128 2277 256 699 512 186 1024 47 2048 12 4096 4
͡Ίͷํ͕҆ఆ ͠ͳ͍͕ɺ16Ҏ߱ظ ௨ΓͷύϑΥʔϚϯεྼԽ͕ ݟΒΕΔ
҆ఆ͠ͳ͍ཧ༝: ϒϥβͷJITίϯύΠϧʹ ͷ͔ͬΔ·Ͱͷϥάʁ ʢৄ͍͠ਓڭ͍͑ͯͩ͘͞ʣ
2. Performance #2
LayoutTests/perf/document- contains.html
ظ͢Δಈ࡞: > document.contains() ͷ ࣌ؒܭࢉྔ͕O(1)Ͱ͋Δ͜ͱ
magnitude iterations 2 70107 4 59787 8 95958 16 129782
32 128047 64 130236 128 140427 256 122163 512 115772 1024 130717 2048 117249 4096 138466
Γ͡Ίෆ҆ఆ͕ͩɺ 16͘Β͍͔ΒҰఆͷΛ อ͍ͬͯΔ
·ͱΊ
Undocumentedͳ༷ڍಈ Ͱ͋ͬͯɺϒϥβͷ ςετίʔυ ͪΌΜͱ͋ͬͨΓ͢Δ
=> ༷͚ͩͰͳ͘ɺ ࣮ʹͱͮ͘ڍಈ͕ ཧղͰ͖Δ
ϑΝΠϧ໊આ໌తͰɺ HTML/JSͰॻ͔Ε͍ͯΔͷͰ ࠶ݱ؆୯
=> ϒϥβͷςετίʔυ ΛಡΜͰ͍͘͜ͱͰɺ JavaScriptΛॻ͘ਓؒʹ ͱֶͬͯͼ͕͋Δ
͓·͚
WebKitϦϙδτϦશମͰ 27ສϑΝΠϧ͕͋ΔͷͰ grepͳͲ͕ΠνΠνਏ͍
- git status: 1-2 - git grep: 10ऑ
ରࡦ1: ιʔείʔυΛ෦తʹ μϯϩʔυ͢Δ
ରࡦ2: maxvodesͱ͍͏ ΧʔωϧύϥϝʔλͷΛ ্͛Δ
edwardkenfox.com/blog/ browser-test-code-for-jsers/