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

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

Issue 2003593002: Add tests for webRequest events and frame unload (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 // Opens a cross-origin frame (a http-URL in this chrome-extension tab) and
battre 2016/05/23 11:17:07 s/frame/iframe/
robwu 2016/05/23 11:51:03 Done.
7 // remove it.
battre 2016/05/23 11:17:07 nit: removes
robwu 2016/05/23 11:51:03 Done.
8 function insertSlowCrossOriginFrameAndRemove() {
9 const url = getSlowURL('frame-in-extension-url');
10
11 expect([
12 { label: 'onBeforeRequest',
13 event: 'onBeforeRequest',
14 details: {
15 type: 'sub_frame',
16 url,
battre 2016/05/23 11:17:07 is "url" a shortcut for url: url?
robwu 2016/05/23 11:51:03 Yes. That's new in ES6.
17 frameId: 1,
18 parentFrameId: 0,
19 frameUrl: url,
20 tabId: 1,
21 }
22 },
23 { label: 'onBeforeSendHeaders',
24 event: 'onBeforeSendHeaders',
25 details: {
26 type: 'sub_frame',
27 url,
28 frameId: 1,
29 parentFrameId: 0,
30 tabId: 1,
31 },
32 },
33 { label: 'onSendHeaders',
34 event: 'onSendHeaders',
35 details: {
36 type: 'sub_frame',
37 url,
38 frameId: 1,
39 parentFrameId: 0,
40 tabId: 1,
41 },
42 },
43 { label: 'onErrorOccurred',
44 event: 'onErrorOccurred',
45 details: {
46 type: 'sub_frame',
47 url,
48 frameId: 1,
49 parentFrameId: 0,
50 tabId: 1,
51 fromCache: false,
52 error: 'net::ERR_ABORTED',
53 },
54 }],
55 [['onBeforeRequest', 'onBeforeSendHeaders', 'onSendHeaders',
56 'onErrorOccurred']]);
57
58 var f = document.createElement('iframe');
59 f.src = url;
60 waitUntilSendHeaders('sub_frame', url, function() {
61 f.remove();
62 });
63 document.body.appendChild(f);
64 },
65 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698