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

Side by Side Diff: chrome/test/data/extensions/api_test/window_open/panel/test.js

Issue 1094383005: Modified two extension tests to not be dependent on low-latency DOM timers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « chrome/test/data/extensions/api_test/bookmarks/manifest.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 panelWindowId = 0;
6
7 // This function is called by the panel during the test run. 5 // This function is called by the panel during the test run.
8 function panelCallback() { 6 function panelCallback() {
9 // We have now added a panel so the total counts is 2 (browser + panel). 7 // We have now added a panel so the total counts is 2 (browser + panel).
10 chrome.test.assertEq(2, chrome.extension.getViews().length); 8 chrome.test.assertEq(2, chrome.extension.getViews().length);
11 // Verify that we're able to get the view of the panel by its window id.
12 chrome.test.assertEq(1,
13 chrome.extension.getViews({"windowId": panelWindowId}).length);
14 chrome.test.notifyPass(); 9 chrome.test.notifyPass();
15 } 10 }
16 11
17 chrome.test.runTests([ 12 chrome.test.runTests([
18 function openPanel() { 13 function openPanel() {
19 chrome.test.listenOnce(chrome.windows.onCreated, function(window) { 14 chrome.test.listenOnce(chrome.windows.onCreated, function(window) {
20 chrome.test.assertTrue(window.width > 0); 15 chrome.test.assertTrue(window.width > 0);
21 chrome.test.assertTrue(window.height > 0); 16 chrome.test.assertTrue(window.height > 0);
22 chrome.test.assertEq("panel", window.type); 17 chrome.test.assertEq("panel", window.type);
23 chrome.test.assertTrue(!window.incognito); 18 chrome.test.assertTrue(!window.incognito);
24 }); 19 });
25 chrome.windows.create( 20 chrome.windows.create(
26 { 'url': chrome.extension.getURL('panel.html'), 'type': 'panel' }, 21 { 'url': chrome.extension.getURL('panel.html'), 'type': 'panel' },
27 function(win) { 22 function(win) {
28 chrome.test.assertEq('panel', win.type); 23 chrome.test.assertEq('panel', win.type);
29 chrome.test.assertEq(true, win.alwaysOnTop); 24 chrome.test.assertEq(true, win.alwaysOnTop);
30 panelWindowId = win.id; 25 // Verify that we're able to get the view of the panel by its
26 // window id.
27 chrome.test.assertEq(1,
28 chrome.extension.getViews({"windowId": win.id}).length);
not at google - send to devlin 2015/04/24 22:18:10 This test still has a small problem, where if pane
31 // The panel will call back to us through panelCallback (above). 29 // The panel will call back to us through panelCallback (above).
32 }); 30 });
33 } 31 }
34 ]); 32 ]);
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/bookmarks/manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698