Chromium Code Reviews
DescriptionDevTools: 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 #Messages
Total messages: 33 (24 generated)
|