Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / tabs / basics / crash.js
blob86a26f5a86669458a87efb6b9506caf0bcacba5c
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.
5 var INDUCE_BROWSER_CRASH_URL = 'about:inducebrowsercrashforrealz';
6 var INDUCE_RENDERER_CRASH_URL = 'about:crash';
7 var ERROR = "I'm sorry. I'm afraid I can't do that.";
9 var succeed = chrome.test.succeed;
10 var callbackFail = chrome.test.callbackFail;
12 chrome.test.runTests([
14   function crashBrowserTabsCreate() {
15     chrome.tabs.create({url: INDUCE_BROWSER_CRASH_URL}, callbackFail(ERROR));
16   },
18   function crashBrowserWindowCreate() {
19     chrome.windows.create({url: INDUCE_BROWSER_CRASH_URL}, callbackFail(ERROR));
20   },
22   function crashBrowserWindowCreateArray() {
23     var urls = ['about:blank', INDUCE_BROWSER_CRASH_URL];
24     chrome.windows.create({url: urls}, callbackFail(ERROR));
25   },
27   function crashBrowserTabsUpdate() {
28     chrome.tabs.create({url: 'about:blank'}, function(tab) {
29       chrome.tabs.update(tab.id,
30                          {url: INDUCE_BROWSER_CRASH_URL},
31                          callbackFail(ERROR));
32     });
33   },
35   function crashRendererTabsCreate() {
36     chrome.tabs.create({url: INDUCE_RENDERER_CRASH_URL}, callbackFail(ERROR));
37   },
39   function crashRendererWindowCreate() {
40     chrome.windows.create({url: INDUCE_RENDERER_CRASH_URL},
41                           callbackFail(ERROR));
42   },
44   function crashRendererWindowCreateArray() {
45     var urls = ['about:blank', INDUCE_RENDERER_CRASH_URL];
46     chrome.windows.create({url: urls}, callbackFail(ERROR));
47   },
49   function crashRendererTabsUpdate() {
50     chrome.tabs.create({url: 'about:blank'}, function(tab) {
51       chrome.tabs.update(
52         tab.id, {url: INDUCE_RENDERER_CRASH_URL}, callbackFail(ERROR));
53     });
54   }
56 ]);