Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(933)

Side by Side Diff: chrome/test/data/extensions/api_test/webrequest/test_unload2.js

Issue 2003593002: Add tests for webRequest events and frame unload (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: battre's nits Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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.
4
5 runTests([
6 // Load a slow page in a tab and close it.
7 function loadSlowTabAndClose() {
8 const url = getSlowURL('slow-single-main-frame');
9
10 expect([
11 { label: 'onBeforeRequest',
12 event: 'onBeforeRequest',
13 details: {
14 type: 'main_frame',
15 url,
16 frameUrl: url,
17 }
18 },
19 { label: 'onBeforeSendHeaders',
20 event: 'onBeforeSendHeaders',
21 details: {
22 type: 'main_frame',
23 url,
24 },
25 },
26 { label: 'onSendHeaders',
27 event: 'onSendHeaders',
28 details: {
29 type: 'main_frame',
30 url,
31 },
32 },
33 { label: 'onErrorOccurred',
34 event: 'onErrorOccurred',
35 details: {
36 type: 'main_frame',
37 url,
38 fromCache: false,
39 error: 'net::ERR_ABORTED',
40 },
41 }],
42 [['onBeforeRequest', 'onBeforeSendHeaders', 'onSendHeaders',
43 'onErrorOccurred']]);
44
45 var callbackDone = chrome.test.callbackAdded();
46
47 waitUntilSendHeaders('main_frame', url, function() {
48 // Cancels load and triggers onErrorOccurred.
49 chrome.tabs.remove(tabId, callbackDone);
50 }),
51 chrome.tabs.update(tabId, {url});
52 },
53 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698