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

Unified Diff: chrome/test/data/extensions/api_test/tabs/basics/discarded.js

Issue 2205523002: AutoDiscardable property support on Chrome Extensions Tabs API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change javascript test 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/tabs/basics/discarded.js
diff --git a/chrome/test/data/extensions/api_test/tabs/basics/discarded.js b/chrome/test/data/extensions/api_test/tabs/basics/discarded.js
deleted file mode 100644
index 7d212a82c37aeeb40bcb08dc2ed444ea3d519d20..0000000000000000000000000000000000000000
--- a/chrome/test/data/extensions/api_test/tabs/basics/discarded.js
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
Devlin 2016/08/11 16:45:54 To make the diff a little cleaner, can we keep the
Anderson Silva 2016/08/11 17:26:57 Done.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var testTab;
-chrome.test.runTests([
-
- function setupWindow() {
- var testTabId;
-
- createWindow(["about:blank", "chrome://newtab/"], {},
- pass(function(winId, tabIds) {
- testTabId = tabIds[1];
- }));
-
- waitForAllTabs(pass(function() {
- queryForTab(testTabId, {}, pass(function(tab) {
- testTab = tab;
- }));
- }));
- },
-
- function discard() {
- // Initially tab isn't discarded.
- assertFalse(testTab.discarded);
-
- var onUpdatedCompleted = chrome.test.listenForever(
- chrome.tabs.onUpdated,
- function(tabId, changeInfo, tab) {
- if ('discarded' in changeInfo) {
- // Make sure it's the right tab.
- assertEq(testTab.index, tab.index);
- assertEq(testTab.windowId, tab.windowId);
-
- // Make sure the discarded state changed correctly.
- assertTrue(changeInfo.discarded);
- assertTrue(tab.discarded);
-
- onUpdatedCompleted();
- }
- });
-
- // TODO(georgesak): Remove tab update when http://crbug.com/632839 is
- // resolved.
- // Discard and update testTab (the id changes after a tab is discarded).
- chrome.tabs.discard(testTab.id, pass(function(tab) {
- assertTrue(tab.discarded);
- testTab = tab;
- }));
- },
-
- function reload() {
- // Tab is already discarded.
- assertTrue(testTab.discarded);
-
- var onUpdatedCompleted = chrome.test.listenForever(
- chrome.tabs.onUpdated,
- function(tabId, changeInfo, tab) {
- if ('discarded' in changeInfo) {
- // Make sure it's the right tab.
- assertEq(testTab.index, tab.index);
- assertEq(testTab.windowId, tab.windowId);
-
- // Make sure the discarded state changed correctly.
- assertFalse(changeInfo.discarded);
- assertFalse(tab.discarded);
-
- onUpdatedCompleted();
- }
- });
-
- chrome.tabs.reload(testTab.id);
- }
-]);

Powered by Google App Engine
This is Rietveld 408576698