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

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

Issue 2238383003: webRequest: Also identify frames for non-RDH-initiated requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 function getPageWithOSDDURL() {
6 // A document with path "/" linking to |getOSDDURL()|.
7 // OSDD are only loaded from "/".
Marijn Kruisselbrink 2016/08/15 22:02:15 Ah, is that why there is a ServeFilesFromDirectory
robwu 2016/08/17 08:44:32 Done.
8 return getServerURL('');
9 }
10
11 function getOSDDURL() {
12 // Referenced by |getPageWithOSDDURL()|, the response is not import
Marijn Kruisselbrink 2016/08/15 22:02:15 This comment seems to have been cut off? Also I g
robwu 2016/08/17 08:44:32 Done.
13 return getServerURL('opensearch-dont-ignore-me.xml');
14 }
15
16
17 runTests([
18 function test_linked_open_search_description() {
19 expect([
20 { label: 'onBeforeRequest',
21 event: 'onBeforeRequest',
22 details: {
23 type: 'other',
24 url: getOSDDURL(),
25 // Not getPageWithOSDDURL() because we are only listening to requests
26 // of type "other".
27 frameUrl: 'unknown frame URL',
28 tabId: 0,
29 }
30 },
31 { label: 'onBeforeSendHeaders',
32 event: 'onBeforeSendHeaders',
33 details: {
34 type: 'other',
35 url: getOSDDURL(),
36 tabId: 0,
37 },
38 },
39 { label: 'onSendHeaders',
40 event: 'onSendHeaders',
41 details: {
42 type: 'other',
43 url: getOSDDURL(),
44 tabId: 0,
45 },
46 },
47 { label: 'onHeadersReceived',
48 event: 'onHeadersReceived',
49 details: {
50 type: 'other',
51 url: getOSDDURL(),
52 tabId: 0,
53 statusLine: 'HTTP/1.1 404 Not Found',
54 statusCode: 404,
55 },
56 },
57 { label: 'onResponseStarted',
58 event: 'onResponseStarted',
59 details: {
60 type: 'other',
61 url: getOSDDURL(),
62 tabId: 0,
63 ip: '127.0.0.1',
64 fromCache: false,
65 statusLine: 'HTTP/1.1 404 Not Found',
66 statusCode: 404,
67 },
68 },
69 { label: 'onCompleted',
70 event: 'onCompleted',
71 details: {
72 type: 'other',
73 url: getOSDDURL(),
74 tabId: 0,
75 ip: '127.0.0.1',
76 fromCache: false,
77 statusLine: 'HTTP/1.1 404 Not Found',
78 statusCode: 404,
79 },
80 }],
81 [['onBeforeRequest', 'onBeforeSendHeaders', 'onSendHeaders',
82 'onHeadersReceived', 'onResponseStarted', 'onCompleted']],
83 {urls: ['<all_urls>'], types: ['other']});
84
85 navigateAndWait(getPageWithOSDDURL(), function() {
86 console.log('Navigated to ' + getPageWithOSDDURL());
87 });
88 },
89 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698