-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Copy pathset-custom-prevalent-resource-in-debug-mode.html
35 lines (32 loc) · 1.34 KB
/
set-custom-prevalent-resource-in-debug-mode.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="/js-test-resources/js-test.js"></script>
<script src="resources/util.js"></script>
</head>
<body>
<script>
description("Test for enabling debug mode and that it allows setting a custom domain as a prevalent resource.");
jsTestIsAsync = true;
const thirdPartyOrigin = "http://localhost:8000";
if (window.testRunner && window.internals) {
setEnableFeature(true, function() {
if (testRunner.isStatisticsPrevalentResource(thirdPartyOrigin))
testFailed(thirdPartyOrigin + " already set as prevalent resource.");
testRunner.setStatisticsPrevalentResourceForDebugMode(thirdPartyOrigin, function() {
testRunner.setStatisticsDebugMode(true, function() {
if (!testRunner.isStatisticsPrevalentResource(thirdPartyOrigin))
testFailed(thirdPartyOrigin + " didn't get set as prevalent resource.");
else
testPassed(thirdPartyOrigin + " got set as a custom prevalent resource in debug mode.");
testRunner.setStatisticsDebugMode(false, function() {
setEnableFeature(false, finishJSTest);
});
});
});
});
}
</script>
</body>
</html>