Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / webnavigation / crash / test_crash.js
blob6920579df7fcc8ce88cc03f51ca037168a95d368
1 // Copyright 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 onload = function() {
6   var URL_A =
7       "http://www.a.com:PORT/extensions/api_test/webnavigation/crash/a.html";
8   var URL_B =
9       "http://www.a.com:PORT/extensions/api_test/webnavigation/crash/b.html";
10   chrome.tabs.create({"url": "about:blank"}, function(tab) {
11     var tabId = tab.id;
12     chrome.test.getConfig(function(config) {
13       var fixPort = function(url) {
14         return url.replace(/PORT/g, config.testServer.port);
15       };
16       URL_A = fixPort(URL_A);
17       URL_B = fixPort(URL_B);
19       chrome.test.runTests([
20         // Navigates to an URL, then the renderer crashes, the navigates to
21         // another URL.
22         function crash() {
23           expect([
24             { label: "a-onBeforeNavigate",
25               event: "onBeforeNavigate",
26               details: { frameId: 0,
27                          parentFrameId: -1,
28                          processId: 0,
29                          tabId: 0,
30                          timeStamp: 0,
31                          url: URL_A }},
32             { label: "a-onCommitted",
33               event: "onCommitted",
34               details: { frameId: 0,
35                          processId: 0,
36                          tabId: 0,
37                          timeStamp: 0,
38                          transitionQualifiers: [],
39                          transitionType: "typed",
40                          url: URL_A }},
41             { label: "a-onDOMContentLoaded",
42               event: "onDOMContentLoaded",
43               details: { frameId: 0,
44                          processId: 0,
45                          tabId: 0,
46                          timeStamp: 0,
47                          url: URL_A }},
48             { label: "a-onCompleted",
49               event: "onCompleted",
50               details: { frameId: 0,
51                          processId: 0,
52                          tabId: 0,
53                          timeStamp: 0,
54                          url: URL_A }},
55             { label: "b-onBeforeNavigate",
56               event: "onBeforeNavigate",
57               details: { frameId: 0,
58                          parentFrameId: -1,
59                          processId: 0,
60                          tabId: 0,
61                          timeStamp: 0,
62                          url: URL_B }},
63             { label: "b-onCommitted",
64               event: "onCommitted",
65               details: { frameId: 0,
66                          processId: 0,
67                          tabId: 0,
68                          timeStamp: 0,
69                          transitionQualifiers: [],
70                          transitionType: "typed",
71                          url: URL_B }},
72             { label: "b-onDOMContentLoaded",
73               event: "onDOMContentLoaded",
74               details: { frameId: 0,
75                          processId: 0,
76                          tabId: 0,
77                          timeStamp: 0,
78                          url: URL_B }},
79             { label: "b-onCompleted",
80               event: "onCompleted",
81               details: { frameId: 0,
82                          processId: 0,
83                          tabId: 0,
84                          timeStamp: 0,
85                          url: URL_B }}],
86             [ navigationOrder("a-"), navigationOrder("b-") ]);
88           // Notify the api test that we're waiting for the user.
89           chrome.test.notifyPass();
90         },
91       ]);
92     });
93   });