Do not announce robot account token before account ID is available
[chromium-blink-merge.git] / chrome / test / data / extensions / management / self_uninstall_helper / background.js
blobefadd88ea75077f660597c049a0d7b22b45dbaf3
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 // The name of the extension to uninstall, from manifest.json.
6 var EXPECTED_NAME = "Self Uninstall Test";
8 chrome.management.onUninstalled.addListener(function(id) {
9   chrome.management.getAll(function(items) {
10     var found = false;
11     for (var i = 0; i < items.length; i++) {
12       chrome.test.assertTrue(id != items.id);
13       if (items[i].name != EXPECTED_NAME) continue;
14       found = true;
15     }
16     chrome.test.assertFalse(found);
17     chrome.test.sendMessage("success");
18   });
19 });