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

Side by Side Diff: LayoutTests/fast/dom/Window/window-focus-self.html

Issue 14735005: Disallow a window focusing itself via javascript URLs or using target _self (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/window-focus-self-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5 function runTest() {
6 window.onfocus = windowFocused;
7 window.onblur = windowBlurred;
8
9 if (window.testRunner) {
10 testRunner.waitUntilDone();
11 testRunner.dumpAsText();
12 testRunner.setWindowIsKey(false);
13 window.open('javascript:window.focus()', '_self', '');
14 setTimeout(function() { testRunner.notifyDone(); }, 0);
15 }
16 }
17
18 function log(message) {
19 var console = document.getElementById("console");
20 var li = document.createElement("li");
21 var text = document.createTextNode(message);
22
23 console.appendChild(li);
24 li.appendChild(text);
25 }
26
27 function windowFocused() {
28 log("FAIL: Window was focused");
29 }
30
31 function windowBlurred() {
32 log("Window was blurred");
33 }
34 </script>
35 </head>
36 <body>
37 This tests that a window cannot focus itself by using javascript: urls.
38 <ul id="console"></ul>
39 <script>runTest();</script>
40 </body>
41 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/window-focus-self-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698