| Index: third_party/WebKit/LayoutTests/http/tests/security/rel-noopener/window-open.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/security/rel-noopener/window-open.html b/third_party/WebKit/LayoutTests/http/tests/security/rel-noopener/window-open.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..5b68b3e79d072bb450014eaa44b7c3d1e6d2275d
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/security/rel-noopener/window-open.html
|
| @@ -0,0 +1,38 @@
|
| +<!DOCTYPE html>
|
| +<script src="/resources/testharness.js"></script>
|
| +<script src="/resources/testharnessreport.js"></script>
|
| +<script>
|
| + if (window.testRunner)
|
| + testRunner.setCanOpenWindows();
|
| +
|
| + var windowsInThisProcess = 1; // This window counts.
|
| +
|
| + test(t => {
|
| + var w = window.open("", "", "noopener");
|
| + assert_equals(w, null);
|
| + if (window.testRunner)
|
| + assert_equals(testRunner.windowCount(), windowsInThisProcess, "Should have opened a window in a new process.");
|
| + }, "window.open returns 'null' when 'noopener' present.");
|
| +
|
| + test(t => {
|
| + var w1 = window.open("", "windowname1", "noopener");
|
| + if (window.testRunner)
|
| + assert_equals(testRunner.windowCount(), windowsInThisProcess, "Should have opened a window in a new process.");
|
| + var w2 = window.open("", "windowname1");
|
| + if (window.testRunner)
|
| + assert_equals(testRunner.windowCount(), ++windowsInThisProcess, "Should have opened a window in this process.");
|
| + assert_equals(w1, null);
|
| + assert_not_equals(w2, null);
|
| + }, "Opening a named window as noopener, then normally should work.");
|
| +
|
| + test(t => {
|
| + var w1 = window.open("", "windowname2");
|
| + if (window.testRunner)
|
| + assert_equals(testRunner.windowCount(), ++windowsInThisProcess, "Should have opened a window in this process.");
|
| + var w2 = window.open("", "windowname2", "noopener");
|
| + if (window.testRunner)
|
| + assert_equals(testRunner.windowCount(), windowsInThisProcess, "Should have opened a window a new process.");
|
| + assert_not_equals(w1, null);
|
| + assert_equals(w2, null);
|
| + }, "Opening a named window normally, then as noopener should work.");
|
| +</script>
|
|
|