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

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

Issue 2263863002: Remove implementation of Panels on OSes other than ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR feedback Created 4 years, 4 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 var panelWindowId = 0;
6 var panelLoaded = false;
7
8 // This function is called by the panel during the test run.
9 function panelCallback() {
10 panelLoaded = true;
11 maybeReadyForTest();
12 }
13
14 function maybeReadyForTest() {
15 // The order of the two callbacks is not guaranteed.
16 if( panelWindowId === 0 || !panelLoaded)
17 return;
18
19 // We have now added a panel so the total counts is 2 (browser + panel).
20 chrome.test.assertEq(2, chrome.extension.getViews().length);
21 // Verify that we're able to get the view of the panel by its window id.
22 chrome.test.assertEq(1,
23 chrome.extension.getViews({"windowId": panelWindowId}).length);
24 chrome.test.notifyPass();
25 }
26
27 chrome.test.runTests([
28 function openPanel() {
29 chrome.test.listenOnce(chrome.windows.onCreated, function(window) {
30 chrome.test.assertTrue(window.width > 0);
31 chrome.test.assertTrue(window.height > 0);
32 chrome.test.assertEq("panel", window.type);
33 chrome.test.assertTrue(!window.incognito);
34 });
35 chrome.windows.create(
36 { 'url': chrome.extension.getURL('panel.html'), 'type': 'panel' },
37 function(win) {
38 chrome.test.assertEq('panel', win.type);
39 chrome.test.assertEq(true, win.alwaysOnTop);
40 panelWindowId = win.id;
41 // The panel will call back to us through panelCallback (above).
42 maybeReadyForTest();
43 });
44 }
45 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698