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
Edward Fox
April 28, 2017
Programming
3
2.3k
JSerのための ブラウザコードリーディング (テスト編)
Meguro.es x Gotanda.js #1 in Drecom
https://meguroes.connpass.com/event/49543/
Edward Fox
April 28, 2017
Tweet
Share
More Decks by Edward Fox
See All by Edward Fox
Priorityを制するものはローディングを制す
edwardkenfox
4
460
Lambda@Edgeを利用したサードパーティJavaScriptのカナリアリリース / Canary release using Lamdba@Edge
edwardkenfox
0
50
AWS re:Invent 2019 / Hackathon for Good 参加録
edwardkenfox
2
440
Repro basketball club
edwardkenfox
0
170
Introduction to UX Optimizer
edwardkenfox
0
69
フロントエンド開発の落とし穴 / Fallacies of Client Side Programming (2019ver)
edwardkenfox
0
230
僕とprototypeとJSONで / Me and prototype down by the JSON
edwardkenfox
0
96
クライアントサイド開発の落とし穴 / Fallacies of Client Side Programming
edwardkenfox
0
290
Beacon API ことはじめ 〜そしてkeepalive fetchへ〜 / Beacon API The Basics
edwardkenfox
0
950
Other Decks in Programming
See All in Programming
SwiftUI Performance 不要なViewの再描画と更新を抑える
bigamitiongit
1
160
Micro Frontends for Java Microservices - Devnexus 2024
mraible
PRO
0
430
スクラムガイドのスプリントレトロスペクティブを改めて読みかえしてみた / Re-reading the Sprint Retrospective Section in the Scrum Guide
mackey0225
3
330
ログラスを支える設計標準について / loglass-design-standards
urmot
10
2.1k
try!Swift Tokyo 2024 参加報告 LT
akidon0000
1
190
0→1と1→10の狭間で Javaという技術選定を振り返る/Reflecting on the Decision to Choose Java Between Scaling from 0 to 1 and 1 to 10
jaguar_imo
2
370
Rails と人魚の話/rails-and-mermaid
sanfrecce_osaka
0
100
Build with AI 2024 Seoul - 제로부터 시작하는 Flutter with Gemini 생활 - 박제창
itsmedreamwalker
0
200
チーム力を高めるスクラム実践法:カンバン公開と課題攻略について - ニフティのスクラムトーク Vol. 2 - NIFTY Tech Talk #18
niftycorp
PRO
1
110
二郎系ラーメンのコールで学ぶ AST 解析
memory1994
PRO
7
1.7k
PHPの次期バージョンはこの時期どうなっているのか - Internalsの開発体制について - PHPカンファレンス小田原
youkidearitai
PRO
1
180
Tailwind CSSを本気でカスタマイズする方法
fsubal
2
260
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
16
6.4k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
24
2.3k
BBQ
matthewcrist
80
8.7k
Why You Should Never Use an ORM
jnunemaker
PRO
50
8.6k
What's in a price? How to price your products and services
michaelherold
237
11k
Infographics Made Easy
chrislema
237
18k
Code Reviewing Like a Champion
maltzj
513
39k
Building Better People: How to give real-time feedback that sticks.
wjessup
354
18k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
76
41k
Facilitating Awesome Meetings
lara
41
5.6k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
29
6k
Writing Fast Ruby
sferik
620
60k
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/