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

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

Issue 1642583002: Fix bug with invalid chrome.sessions.onChanged listener. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo Created 4 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 unified diff | Download patch
« no previous file with comments | « chrome/test/data/extensions/api_test/sessions/onchanged/onchanged.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 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 function listener() {
6 }
7
8 // 0. After start, add and remove onChanged listener.
9 // 1. Create incognito window.
10 // 2. Remove the initial window.
11 // 3. Create new window.
12 // 4. Remove incognito window.
13 // 5. Register listener and check it works.
14 chrome.test.runTests([
15 function onChangedTest() {
16 chrome.sessions.onChanged.addListener(listener);
17 chrome.sessions.onChanged.removeListener(listener);
18 chrome.windows.getCurrent(function(win) {
19 first_win = win;
20 chrome.windows.create({incognito:true}, function(win) {
21 incognito_win = win;
22 chrome.windows.remove(first_win.id, function() {
23 chrome.windows.create({url:chrome.extension.getURL("../a.html")},
24 function(win) {
25 new_win = win;
26 chrome.windows.remove(incognito_win.id, function() {
27 callbackCount = 0;
28 chrome.test.listenForever(chrome.sessions.onChanged, function() {
29 callbackCount++;
30 });
31 chrome.tabs.remove(new_win.tabs[0].id, function() {
32 chrome.test.assertTrue(callbackCount > 0);
33 chrome.test.succeed();
34 });
35 });
36 });
37 });
38 });
39 });
40 }
41 ]);
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/sessions/onchanged/onchanged.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698