Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / tabs / on_replaced / test_onreplaced.js
blob48b78803430de2a8f8f2e74749e77a367fcefca4
1 // Copyright (c) 2012 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.
5 onload = function() {
6 chrome.test.getConfig(function(config) {
7 chrome.tabs.create({"url": "about:blank"}, function(tab) {
8 chrome.test.runTests([
9 function onReplacedEvent() {
10 var tabId = tab.id;
12 var onReplaceListener = function(new_tab_id, old_tab_id) {
13 chrome.test.assertTrue(tabId != new_tab_id);
14 chrome.test.assertEq(tabId, old_tab_id);
15 chrome.tabs.onReplaced.removeListener(onReplaceListener);
16 chrome.test.succeed();
18 chrome.tabs.onReplaced.addListener(onReplaceListener);
20 chrome.test.notifyPass();
22 ]);
23 });
24 });