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

Unified Diff: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/switch-file.html

Issue 2747863007: DevTools: clean up tests to not depend on NetworkProject.addFile method (Closed)
Patch Set: typo Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/switch-file.html
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/switch-file.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/switch-file.html
index 39e2923dd177389cab809674807f6b695a2be111..f1c3aec6088923170fced1aee3371cae369284da 100644
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/switch-file.html
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/switch-file.html
@@ -1,18 +1,10 @@
<html>
<head>
<script src="../../../http/tests/inspector/inspector-test.js"></script>
-<script src="../../../http/tests/inspector/debugger-test.js"></script>
+<script src="../../../http/tests/inspector/page-mock.js"></script>
<script>
-function test()
+async function test()
{
- var uiSourceCodes = [];
- function addUISourceCode(url)
- {
- var contentProvider = Common.StaticContentProvider.fromString(url, Common.resourceTypes.Script, "");
- var uiSourceCode = Bindings.NetworkProject.forTarget(InspectorTest.mainTarget).addFile(contentProvider, InspectorTest.mainFrame(), false);
- uiSourceCodes.push(uiSourceCode);
- }
-
var files = [
"foo.css",
"foo.js",
@@ -38,9 +30,16 @@ function test()
"bar/foo.js.map",
"bar/foo.ts",
"bar/foo" ];
+ files = files.map(file => 'http://example.com/' + file);
- for (var i = 0; i < files.length; ++i)
- addUISourceCode("http://example.com/" + files[i]);
+ var page = new InspectorTest.PageMock('http://example.com');
+ InspectorTest.connectToPage('mock-page', page);
+
+ var uiSourceCodes = [];
+ for (var i = 0; i < files.length; ++i) {
+ page.evalScript(files[i], '', false /* isContentScript */);
+ uiSourceCodes.push(await InspectorTest.waitForUISourceCode(files[i]));
+ }
InspectorTest.addResult("Dumping next file for each file:");
for (var i = 0; i < uiSourceCodes.length; ++i) {

Powered by Google App Engine
This is Rietveld 408576698