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

Side by Side Diff: chrome/test/data/extensions/api_test/permissions/optional_updates_bindings/background.js

Issue 1142993002: Don't send unnecessary ExtensionMsg_Loaded IPCs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: a test Created 5 years, 6 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
OLDNEW
(Empty)
1 // Copyright 2015 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 // window.html will turn around and call this when it loads.
6 // |otherWindow| is its window object.
7 function runTest(otherWindow) {
8 chrome.test.runWithUserGesture(function() {
9 chrome.permissions.request({permissions: ['alarms']}, function(granted) {
10 chrome.test.assertTrue(granted);
11 // Assert that the bindings have been updated on ourselves the background
12 // page, and the tab that was created.
13 var expectedAlarmsKeys = [
14 'clear', 'clearAll', 'create', 'get', 'getAll', 'onAlarm'];
15 [window, otherWindow].forEach(function(w) {
16 chrome.test.assertEq(expectedAlarmsKeys,
17 Object.keys(w.chrome.alarms).sort());
Devlin 2015/06/03 20:53:37 While the alarms api is pretty stable, I think it'
not at google - send to devlin 2015/06/03 21:53:03 I think it's stronger to check all, and I don't se
18 });
19 chrome.test.succeed();
20 });
21 });
22 }
23
24 // This is the important part; creating a new window would cause the optional
25 // pemissions to be updated on itself, rather than both the window and the
26 // background page.
27 chrome.tabs.create({url: 'window.html'});
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698