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

Side by Side Diff: chrome/test/data/extensions/api_test/tabs/basics/audible.js

Issue 987583004: Add audible, muted to Tab, c.t.query, c.t.update, and c.t.onUpdated where relevant (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@patch1
Patch Set: followups through message #33 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 (c) 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 var testTabId_;
6
7 function getOnlyTab() {
8 var views = chrome.extension.getViews({type: "tab"});
9 assertEq(1, views.length);
10 return views[0];
11 }
12
13 chrome.test.runTests([
14 function setupWindow() {
15 chrome.tabs.getCurrent(pass(function(tab) {
16 testTabId_ = tab.id;
17 }));
18 },
19
20 function audibleStartsFalse() {
21 chrome.tabs.get(testTabId_, pass(function(tab) {
22 assertEq(false, tab.audible);
23 queryForTab(testTabId_, {audible: false}, pass(function(tab) {
24 assertEq(false, tab.audible);
25 }));
26 queryForTab(testTabId_, {audible: true}, pass(function(tab) {
27 assertEq(undefined, tab);
28 }));
29 }));
30 },
31
32 function audibleUpdateAttemptShouldFail() {
33 var error_msg = "Invalid value for argument 2. Property 'audible': " +
34 "Unexpected property.";
35
36 try
37 {
38 chrome.tabs.update(testTabId_, {audible: true}, function(tab) {
39 chrome.test.fail("Updated audible property via chrome.tabs.update");
40 });
41 } catch (e)
42 {
43 assertEq(error_msg, e.message);
44 chrome.test.succeed();
45 }
46 },
47
48 function makeAudible() {
49 onUpdatedExpect("audible", true, null);
50 getOnlyTab().enableSineWave();
51 },
52
53 function testStaysAudibleAfterChangingWindow() {
54 chrome.windows.create({}, pass(function(window)
55 {
56 chrome.tabs.move(testTabId_, {windowId: window.id, index: -1},
57 pass(function(tab) {
58 assertEq(true, tab.audible);
59 }));
60 }));
61 },
62
63 function makeNotAudible() {
64 onUpdatedExpect("audible", false, null);
65 getOnlyTab().disableSineWave();
66 }
67 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698