OLD | NEW |
(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 var testTabId_; |
| 6 |
| 7 chrome.test.runTests([ |
| 8 function setupWindow() { |
| 9 chrome.tabs.getCurrent(pass(function(tab) { |
| 10 testTabId_ = tab.id; |
| 11 })); |
| 12 }, |
| 13 |
| 14 function mutedStartsFalse() { |
| 15 chrome.tabs.get(testTabId_, pass(function(tab) { |
| 16 assertEq(false, tab.muted); |
| 17 |
| 18 queryForTab(testTabId_, {muted: false}, pass(function(tab) { |
| 19 assertEq(false, tab.muted); |
| 20 })); |
| 21 queryForTab(testTabId_, {muted: true} , pass(function(tab) { |
| 22 assertEq(null, tab); |
| 23 })); |
| 24 })); |
| 25 }, |
| 26 |
| 27 function makeMuted() { |
| 28 onUpdatedExpect("muted", true, {mutedCause: chrome.runtime.id}); |
| 29 chrome.tabs.update(testTabId_, {muted: true}, pass()); |
| 30 }, |
| 31 |
| 32 function testStaysMutedAfterChangingWindow() { |
| 33 chrome.windows.create({}, pass(function(window) |
| 34 { |
| 35 chrome.tabs.move(testTabId_, {windowId: window.id, index: -1}, |
| 36 pass(function(tab) { |
| 37 assertEq(true, tab.muted); |
| 38 })); |
| 39 })); |
| 40 }, |
| 41 |
| 42 function makeNotMuted() { |
| 43 onUpdatedExpect("muted", false, {mutedCause: chrome.runtime.id}); |
| 44 chrome.tabs.update(testTabId_, {muted: false}, pass()); |
| 45 } |
| 46 ]); |
OLD | NEW |