Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(959)

Issue 2747863007: DevTools: clean up tests to not depend on NetworkProject.addFile method (Closed)

Created:
3 years, 9 months ago by lushnikov
Modified:
3 years, 9 months ago
Reviewers:
dgozman
CC:
chromium-reviews, caseq+blink_chromium.org, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, apavlov+blink_chromium.org, devtools-reviews_chromium.org, blink-reviews, kozyatinskiy+blink_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

DevTools: clean up tests to not depend on NetworkProject.addFile method The NetworkProject.addFile method is adding a UISourceCode for SourceMap source. However, multiple tests abuse the method for their needs. This is unfortunate, since we plan to re-work bindings and eliminate the public "NetworkProject.addFile" method altogether. This patch migrates tests to other methods of adding UISourceCodes: - a InspectorTest.addScriptUISourceCode method is introduced which adds scripts/contentScripts with proper urls in the main target. - a InspectorTest.PageMock is introduced to add scripts in a multi-target tests This implementation of pagemock supports only two methods: - addScript, which adds a script to the mock page and reports it via Debugger.scriptParsed protocol event. - reload(), which "reloads" page, killing all the added scripts Since PageMock's speaks over a very stable devtools protocol, little effort will be needed to maintain it. This is unlike the current solution where tests abuse different public/private binding APIs. R=dgozman BUG=670180 Review-Url: https://codereview.chromium.org/2747863007 Cr-Commit-Position: refs/heads/master@{#457601} Committed: https://chromium.googlesource.com/chromium/src/+/e9ffec31f17a567b537b260f772d649a8f437154

Patch Set 1 #

Patch Set 2 : remove all networkProject.addFile calls #

Total comments: 22

Patch Set 3 : address comments #

Total comments: 4

Patch Set 4 : address comments #

Patch Set 5 : nits #

Patch Set 6 : nits #

Total comments: 4

Patch Set 7 : typo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+504 lines, -281 lines) Patch
M third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js View 1 2 3 2 chunks +14 lines, -6 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js View 1 2 3 4 5 6 1 chunk +249 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-sync-content-nodejs.html View 1 2 chunks +2 lines, -7 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope-many-projects.html View 1 3 chunks +3 lines, -11 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/inspector/sources/navigator-view-content-scripts.html View 1 1 chunk +3 lines, -11 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js View 1 2 1 chunk +11 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/last-execution-context.html View 1 3 chunks +8 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-panel.html View 1 2 2 chunks +34 lines, -29 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-panel-expected.txt View 1 2 3 chunks +15 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-sorting.html View 1 2 3 chunks +13 lines, -13 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/switch-file.html View 1 2 2 chunks +11 lines, -12 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code-display-name.html View 1 1 chunk +8 lines, -28 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/sources/debugger/navigator-view.html View 1 2 4 chunks +56 lines, -34 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/sources/debugger/navigator-view-expected.txt View 1 2 43 chunks +72 lines, -120 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/sources/sources-panel-extension-names.html View 1 1 chunk +2 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/devtools/front_end/bindings/SASSSourceMapping.js View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 33 (24 generated)
lushnikov
please, take a look
3 years, 9 months ago (2017-03-15 05:53:36 UTC) #1
dgozman
https://codereview.chromium.org/2747863007/diff/20001/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js File third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js (right): https://codereview.chromium.org/2747863007/diff/20001/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js#newcode55 third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js:55: InspectorTest.addScriptUISourceCode = async function(url, content, isContentScript, worldId) { I'm ...
3 years, 9 months ago (2017-03-16 00:17:10 UTC) #10
lushnikov
ptal! https://codereview.chromium.org/2747863007/diff/20001/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js File third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js (right): https://codereview.chromium.org/2747863007/diff/20001/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js#newcode55 third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js:55: InspectorTest.addScriptUISourceCode = async function(url, content, isContentScript, worldId) { ...
3 years, 9 months ago (2017-03-16 06:30:50 UTC) #13
dgozman
lgtm https://codereview.chromium.org/2747863007/diff/40001/third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js File third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js (right): https://codereview.chromium.org/2747863007/diff/40001/third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js#newcode119 third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js:119: this._fireEvent("Page.frameNavigated", {frame: this._mainFrame}); Let's send all of the ...
3 years, 9 months ago (2017-03-16 18:04:01 UTC) #22
lushnikov
All done; also, made the harness slightly more general and nicer. https://codereview.chromium.org/2747863007/diff/40001/third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js File third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js (right): ...
3 years, 9 months ago (2017-03-16 20:59:22 UTC) #23
dgozman
https://codereview.chromium.org/2747863007/diff/100001/third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js File third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js (right): https://codereview.chromium.org/2747863007/diff/100001/third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js#newcode41 third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js:41: 'Debugger.getScriptSource': this._debuggergetScriptSource, typo in method name https://codereview.chromium.org/2747863007/diff/100001/third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js#newcode203 third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js:203: if ...
3 years, 9 months ago (2017-03-16 21:12:56 UTC) #26
lushnikov
https://codereview.chromium.org/2747863007/diff/100001/third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js File third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js (right): https://codereview.chromium.org/2747863007/diff/100001/third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js#newcode41 third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js:41: 'Debugger.getScriptSource': this._debuggergetScriptSource, On 2017/03/16 21:12:56, dgozman wrote: > typo ...
3 years, 9 months ago (2017-03-16 21:19:13 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2747863007/120001
3 years, 9 months ago (2017-03-16 21:20:10 UTC) #30
commit-bot: I haz the power
3 years, 9 months ago (2017-03-16 23:19:53 UTC) #33
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/e9ffec31f17a567b537b260f772d...

Powered by Google App Engine
This is Rietveld 408576698