| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="/resources/testharness.js"></script> |
| 3 <script src="/resources/testharnessreport.js"></script> |
| 4 <script> |
| 5 if (window.testRunner) |
| 6 testRunner.setCanOpenWindows(); |
| 7 |
| 8 var windowsInThisProcess = 1; // This window counts. |
| 9 |
| 10 test(t => { |
| 11 var w = window.open("", "", "noopener"); |
| 12 assert_equals(w, null); |
| 13 if (window.testRunner) |
| 14 assert_equals(testRunner.windowCount(), windowsInThisProcess, "Shoul
d have opened a window in a new process."); |
| 15 }, "window.open returns 'null' when 'noopener' present."); |
| 16 |
| 17 test(t => { |
| 18 var w1 = window.open("", "windowname1", "noopener"); |
| 19 if (window.testRunner) |
| 20 assert_equals(testRunner.windowCount(), windowsInThisProcess, "Shoul
d have opened a window in a new process."); |
| 21 var w2 = window.open("", "windowname1"); |
| 22 if (window.testRunner) |
| 23 assert_equals(testRunner.windowCount(), ++windowsInThisProcess, "Sho
uld have opened a window in this process."); |
| 24 assert_equals(w1, null); |
| 25 assert_not_equals(w2, null); |
| 26 }, "Opening a named window as noopener, then normally should work."); |
| 27 |
| 28 test(t => { |
| 29 var w1 = window.open("", "windowname2"); |
| 30 if (window.testRunner) |
| 31 assert_equals(testRunner.windowCount(), ++windowsInThisProcess, "Sho
uld have opened a window in this process."); |
| 32 var w2 = window.open("", "windowname2", "noopener"); |
| 33 if (window.testRunner) |
| 34 assert_equals(testRunner.windowCount(), windowsInThisProcess, "Shoul
d have opened a window a new process."); |
| 35 assert_not_equals(w1, null); |
| 36 assert_equals(w2, null); |
| 37 }, "Opening a named window normally, then as noopener should work."); |
| 38 </script> |
| OLD | NEW |