1 // Copyright (c) 2011 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.
6 window.domAutomationController.send(false);
11 window.domAutomationController.send(true);
14 function testLastError() {
15 // Make sure lastError is not yet set
16 if (chrome.tabs.lastError)
21 // Find the highest tab id
22 chrome.windows.getAll({populate:true}, function(windows) {
23 // Make sure lastError is still not set. (this call have should succeeded).
24 if (chrome.tabs.lastError)
27 for (var i = 0; i < windows.length; i++) {
29 for (var j = 0; j < win.tabs.length; j++) {
30 var tab = win.tabs[j];
31 if (tab.id > maxTabId)
36 // Now ask for the next highest tabId.
37 chrome.tabs.get(maxTabId + 1, function(tab) {
38 // Make sure lastError *is* set and tab is not.
39 if (!chrome.runtime.lastError ||
40 !chrome.runtime.lastError.message ||
44 window.setTimeout(finish, 10);
50 // Now make sure lastError is unset outside the callback context.
51 if (chrome.tabs.lastError)
57 document.documentElement.addEventListener("click", function() {