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));
18 function crashBrowserWindowCreate() {
19 chrome.windows.create({url: INDUCE_BROWSER_CRASH_URL}, callbackFail(ERROR));
22 function crashBrowserWindowCreateArray() {
23 var urls = ['about:blank', INDUCE_BROWSER_CRASH_URL];
24 chrome.windows.create({url: urls}, callbackFail(ERROR));
27 function crashBrowserTabsUpdate() {
28 chrome.tabs.create({url: 'about:blank'}, function(tab) {
29 chrome.tabs.update(tab.id,
30 {url: INDUCE_BROWSER_CRASH_URL},
35 function crashRendererTabsCreate() {
36 chrome.tabs.create({url: INDUCE_RENDERER_CRASH_URL}, callbackFail(ERROR));
39 function crashRendererWindowCreate() {
40 chrome.windows.create({url: INDUCE_RENDERER_CRASH_URL},
44 function crashRendererWindowCreateArray() {
45 var urls = ['about:blank', INDUCE_RENDERER_CRASH_URL];
46 chrome.windows.create({url: urls}, callbackFail(ERROR));
49 function crashRendererTabsUpdate() {
50 chrome.tabs.create({url: 'about:blank'}, function(tab) {
52 tab.id, {url: INDUCE_RENDERER_CRASH_URL}, callbackFail(ERROR));