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

Unified Diff: chrome/test/data/extensions/api_test/streams_private/handle_mime_type/background.js

Issue 185663002: Pass http response headers to the streamsPrivate API callback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/streams_private/handle_mime_type/background.js
diff --git a/chrome/test/data/extensions/api_test/streams_private/handle_mime_type/background.js b/chrome/test/data/extensions/api_test/streams_private/handle_mime_type/background.js
index b60b6c6adc3e9a6e4eda6c7764e0126efc2d81fd..bb55f9771dcd8c45b583ddbe4e08754bf46e5b50 100644
--- a/chrome/test/data/extensions/api_test/streams_private/handle_mime_type/background.js
+++ b/chrome/test/data/extensions/api_test/streams_private/handle_mime_type/background.js
@@ -11,7 +11,15 @@ chrome.streamsPrivate.onExecuteMimeTypeHandler.addListener(
// meant to be handled by the extension. The extension getting an event with
// the MIME type 'application/msword' means the test has succeeded.
if (params.mimeType == 'application/msword') {
- chrome.test.notifyPass();
+ var headers = params.responseHeaders;
+ if (headers.indexOf('Content-Type: application/msword') == -1 ||
+ headers.indexOf('HTTP/1.1 200 OK') == -1) {
+ chrome.test.notifyFail(
+ 'HTTP request header did not contain expected attributes.');
+ hasFailed = true;
+ } else {
+ chrome.test.notifyPass();
+ }
return;
}

Powered by Google App Engine
This is Rietveld 408576698