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

Unified Diff: chrome/test/data/extensions/api_test/infobars/test.js

Issue 923463003: [Extensions] Remove the Infobar API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/infobars/test.js
diff --git a/chrome/test/data/extensions/api_test/infobars/test.js b/chrome/test/data/extensions/api_test/infobars/test.js
deleted file mode 100644
index 90a304d4e8775647b108e04f72995ffab9ddde4b..0000000000000000000000000000000000000000
--- a/chrome/test/data/extensions/api_test/infobars/test.js
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// API test for chrome.extension.infobars.
-// browser_tests.exe --gtest_filter=ExtensionApiTest.Infobars
-
-const assertEq = chrome.test.assertEq;
-
-var windowA = 0;
-var windowB = 0;
-var tabA = 0;
-var tabB = 0;
-
-var tests = [
- function createInfobars() {
- // Only background page should be active at the start.
- assertEq(1, chrome.extension.getViews().length);
-
- // Get the current tab and window (window A), then create a new
- // one (window B).
- chrome.tabs.getSelected(null, function(tab) {
- tabA = tab.id;
- windowA = tab.windowId;
- console.log('tabid: ' + tabA + ' windowA: ' + windowA);
-
- chrome.windows.create({"url": "about:blank"}, function(window) {
- windowB = window.id;
- console.log('windowB: ' + windowB);
-
- // Show infobarA in window A (tab A) (and specify no callback).
- chrome.infobars.show({"path": "infobarA.html", "tabId": tabA});
- // Flow continues in infobarCallbackA.
- });
- });
- }
-];
-
-function infobarCallbackA() {
- // We have now added an infobar so the total count goes up one.
- assertEq(2, chrome.extension.getViews().length);
- assertEq(1, chrome.extension.getViews({"type": "infobar"}).length);
- // Window A should have 1 infobar.
- assertEq(1, chrome.extension.getViews({"type": "infobar",
- "windowId": windowA}).length);
- // Window B should have no infobars.
- assertEq(0, chrome.extension.getViews({"type": "infobar",
- "windowId": windowB}).length);
-
- chrome.tabs.getAllInWindow(windowB, function(tabs) {
- assertEq(1, tabs.length);
- tabB = tabs[0].id;
-
- // Show infobarB in (current) window B (with callback).
- chrome.infobars.show({"path": "infobarB.html", "tabId": tabB},
- function(window) {
- assertEq(window.id, windowB);
- // This infobar will call back to us through infobarCallbackB (below).
- });
- });
-}
-
-function infobarCallbackB() {
- // We have now added an infobar so the total count goes up one.
- assertEq(3, chrome.extension.getViews().length);
- assertEq(2, chrome.extension.getViews({"type": "infobar"}).length);
-
- // Window A should have 1 infobar.
- assertEq(1, chrome.extension.getViews({"type": "infobar",
- "windowId": windowA}).length);
- // Window B should have 1 infobar.
- assertEq(1, chrome.extension.getViews({"type": "infobar",
- "windowId": windowB}).length);
-
- chrome.test.notifyPass();
-}
-
-chrome.test.runTests(tests);
« no previous file with comments | « chrome/test/data/extensions/api_test/infobars/manifest.json ('k') | components/infobars/core/infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698