Do not announce robot account token before account ID is available
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / runtime / uninstall_url / test.js
blob5d42e56f4e14c739ed9649fc5320fee0779e5900
1 // Copyright (c) 2013 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 // extension api test
6 // browser_tests.exe --gtest_filter=ExtensionApiTest.ChromeRuntimeUninstallURL
8 var pass = chrome.test.callbackPass;
9 var uninstall_url = 'http://www.google.com/';
10 var sets_uninstall_url = 'Sets Uninstall Url';
11 var uninstalled = false;
12 chrome.test.runTests([
13   function uninstallURL() {
14     chrome.management.getAll(function(results) {
15       for(var i = 0; i < results.length; i++) {
16         if (results[i].name == sets_uninstall_url) {
17           chrome.test.runWithUserGesture(pass(function() {
18             chrome.management.uninstall(results[i].id, pass(function() {
19               chrome.tabs.query({'url': uninstall_url}, pass(function(tabs) {
20                 chrome.test.assertEq(tabs.length, 1);
21                 chrome.test.assertEq(tabs[0].url, uninstall_url);
22               }));
23             }));
24           }));
25           uninstalled = true;
26           break;
27         }
28       }
29       chrome.test.assertTrue(uninstalled);
30     });
31   }
32 ]);