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

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

Issue 9796012: Revert 127833 - Re-land alexbost's experimental offscreenTabs API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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
Property Changes:
Added: svn:mergeinfo
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // API test for chrome.extension.getViews. 5 // API test for chrome.extension.getViews.
6 // browser_tests.exe --gtest_filter=ExtensionApiTest.GetViews 6 // browser_tests.exe --gtest_filter=ExtensionApiTest.GetViews
7 7
8 const assertEq = chrome.test.assertEq; 8 const assertEq = chrome.test.assertEq;
9 const assertTrue = chrome.test.assertTrue; 9 const assertTrue = chrome.test.assertTrue;
10 10
11 // This function is called by the infobar during the test run. 11 // This function is called by the infobar during the test run.
(...skipping 19 matching lines...) Expand all
31 chrome.test.notifyPass(); 31 chrome.test.notifyPass();
32 } 32 }
33 33
34 var tests = [ 34 var tests = [
35 function getViews() { 35 function getViews() {
36 assertTrue(typeof(chrome.extension.getBackgroundPage()) != "undefined"); 36 assertTrue(typeof(chrome.extension.getBackgroundPage()) != "undefined");
37 assertEq(1, chrome.extension.getViews().length); 37 assertEq(1, chrome.extension.getViews().length);
38 assertEq(0, chrome.extension.getViews({"type": "tab"}).length); 38 assertEq(0, chrome.extension.getViews({"type": "tab"}).length);
39 assertEq(0, chrome.extension.getViews({"type": "infobar"}).length); 39 assertEq(0, chrome.extension.getViews({"type": "infobar"}).length);
40 assertEq(0, chrome.extension.getViews({"type": "notification"}).length); 40 assertEq(0, chrome.extension.getViews({"type": "notification"}).length);
41 41
42 chrome.windows.getAll({populate: true}, function(windows) { 42 chrome.windows.getAll({populate: true}, function(windows) {
43 assertEq(1, windows.length); 43 assertEq(1, windows.length);
44 44
45 // Show an infobar. 45 // Show an infobar.
46 chrome.experimental.infobars.show({tabId: windows[0].tabs[0].id, 46 chrome.experimental.infobars.show({tabId: windows[0].tabs[0].id,
47 "path": "infobar.html"}, 47 "path": "infobar.html"},
48 function(window) { 48 function(window) {
49 assertTrue(window.id > 0); 49 assertTrue(window.id > 0);
50 // The infobar will call back to us through infobarCallback (above). 50 // The infobar will call back to us through infobarCallback (above).
51 }); 51 });
52 52
53 }); 53 });
54 } 54 }
55 ]; 55 ];
56 56
57 chrome.test.runTests(tests); 57 chrome.test.runTests(tests);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698