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

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

Issue 201393002: Add onChanged callback for chrome.sessions API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/sessions/sessions.js
diff --git a/chrome/test/data/extensions/api_test/sessions/sessions.js b/chrome/test/data/extensions/api_test/sessions/sessions.js
index 431edbec72fb11ed0a052bebb3a721a68cc1e13f..31a9c570b2233d3a8563fedc2aa45ef2e9d1db7b 100644
--- a/chrome/test/data/extensions/api_test/sessions/sessions.js
+++ b/chrome/test/data/extensions/api_test/sessions/sessions.js
@@ -108,6 +108,16 @@ chrome.test.runTests([
function retrieveClosedTabs() {
// Check that the recently closed list contains what we expect
// after removing tabs.
+ var expectedCallbackCount = 2, callbackCount = 0;
not at google - send to devlin 2014/03/17 14:21:18 what does this actually test?
wjywbs 2014/03/17 19:27:24 Lines 63-79 of this file describe that this retrie
+ var doneListening = chrome.test.listenForever(
+ chrome.sessions.onRecentlyClosed,
+ function() {
+ callbackCount++;
+ if (callbackCount == expectedCallbackCount)
+ doneListening();
+ }
+ );
+
callForEach(
chrome.tabs.remove,
firstWindowTabIds.slice(0, 2).reverse(),
@@ -134,6 +144,16 @@ chrome.test.runTests([
function retrieveClosedWindows() {
// Check that the recently closed list contains what we expect
// after removing windows.
+ var expectedCallbackCount = 2, callbackCount = 0;
+ var doneListening = chrome.test.listenForever(
+ chrome.sessions.onRecentlyClosed,
+ function() {
+ callbackCount++;
+ if (callbackCount == expectedCallbackCount)
+ doneListening();
+ }
+ );
+
callForEach(
chrome.windows.remove,
windowIds.slice(1, 3).reverse(),
« chrome/common/extensions/api/sessions.json ('K') | « chrome/common/extensions/api/sessions.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698