OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var expectFocusChange; | 5 var expectFocusChange; |
6 var createdWinId; | 6 var createdWinId; |
7 var focusedWinId; | 7 var focusedWinId; |
8 var listenDoneCallback; | 8 var listenDoneCallback; |
9 | 9 |
10 function resetTest(focused) { | 10 function resetTest(focused) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 chrome.test.callbackPass(checkFocused) | 53 chrome.test.callbackPass(checkFocused) |
54 ); | 54 ); |
55 }, | 55 }, |
56 function defaultHasFocusPopup() { | 56 function defaultHasFocusPopup() { |
57 resetTest(true); | 57 resetTest(true); |
58 chrome.windows.create( | 58 chrome.windows.create( |
59 { 'url': 'blank.html', 'type': 'popup' }, | 59 { 'url': 'blank.html', 'type': 'popup' }, |
60 chrome.test.callbackPass(checkFocused) | 60 chrome.test.callbackPass(checkFocused) |
61 ); | 61 ); |
62 }, | 62 }, |
63 function defaultUnfocusedPanel() { | |
64 resetTest(false); | |
65 chrome.windows.create( | |
66 { 'url': 'blank.html', 'type': 'panel' }, | |
67 chrome.test.callbackPass(checkUnfocused) | |
68 ); | |
69 }, | |
70 function withFocus() { | 63 function withFocus() { |
71 resetTest(true); | 64 resetTest(true); |
72 chrome.windows.create( | 65 chrome.windows.create( |
73 { 'url': 'blank.html', 'focused': true }, | 66 { 'url': 'blank.html', 'focused': true }, |
74 chrome.test.callbackPass(checkFocused) | 67 chrome.test.callbackPass(checkFocused) |
75 ); | 68 ); |
76 }, | 69 }, |
77 function withFocusPopup() { | 70 function withFocusPopup() { |
78 resetTest(true); | 71 resetTest(true); |
79 chrome.windows.create( | 72 chrome.windows.create( |
80 { 'url': 'blank.html', 'focused': true, 'type': 'popup' }, | 73 { 'url': 'blank.html', 'focused': true, 'type': 'popup' }, |
81 chrome.test.callbackPass(checkFocused) | 74 chrome.test.callbackPass(checkFocused) |
82 ); | 75 ); |
83 }, | 76 }, |
84 function withFocusPanel() { | |
85 resetTest(true); | |
86 chrome.windows.create( | |
87 { 'url': 'blank.html', 'focused': true, 'type': 'panel' }, | |
88 chrome.test.callbackPass(checkFocused) | |
89 ); | |
90 }, | |
91 function withoutFocus() { | 77 function withoutFocus() { |
92 resetTest(false); | 78 resetTest(false); |
93 chrome.windows.create( | 79 chrome.windows.create( |
94 { 'url': 'blank.html', 'focused': false }, | 80 { 'url': 'blank.html', 'focused': false }, |
95 chrome.test.callbackPass(checkUnfocused) | 81 chrome.test.callbackPass(checkUnfocused) |
96 ); | 82 ); |
97 }, | 83 }, |
98 function withoutFocusPopup() { | 84 function withoutFocusPopup() { |
99 resetTest(false); | 85 resetTest(false); |
100 chrome.windows.create( | 86 chrome.windows.create( |
101 { 'url': 'blank.html', 'focused': false, 'type': 'popup' }, | 87 { 'url': 'blank.html', 'focused': false, 'type': 'popup' }, |
102 chrome.test.callbackPass(checkUnfocused) | 88 chrome.test.callbackPass(checkUnfocused) |
103 ); | 89 ); |
104 }, | |
105 function withoutFocusPanel() { | |
106 resetTest(false); | |
107 chrome.windows.create( | |
108 { 'url': 'blank.html', 'focused': false, 'type': 'panel' }, | |
109 chrome.test.callbackPass(checkUnfocused) | |
110 ); | |
111 } | 90 } |
112 ]); | 91 ]); |
OLD | NEW |