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

Unified Diff: LayoutTests/inspector/documentation/documentation-test.js

Issue 559423004: DevTools: [Documentation] Disable external XHR requests in documentation tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove excessive code Created 6 years, 3 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: LayoutTests/inspector/documentation/documentation-test.js
diff --git a/LayoutTests/inspector/documentation/documentation-test.js b/LayoutTests/inspector/documentation/documentation-test.js
new file mode 100644
index 0000000000000000000000000000000000000000..73dd5eede5f0138af8b2a306cc2bcd0326e4eca8
--- /dev/null
+++ b/LayoutTests/inspector/documentation/documentation-test.js
@@ -0,0 +1,23 @@
+function initialize_DocumentationTests()
+{
+
+InspectorTest.mockLoadXHR = function(urlPrefix, responseText)
+{
+ var originalLoadXHR = window.loadXHR;
+ window.loadXHR = function(url)
+ {
+
+ if (url.startsWith(urlPrefix))
+ return new Promise(load);
+
+ return originalLoadXHR(url);
+
+ function load(successCallback)
+ {
+ successCallback(responseText);
+ return;
+ }
+ }
+}
+
+}

Powered by Google App Engine
This is Rietveld 408576698