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

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

Issue 12381035: Move Mime type handling to streamsPrivate API, so that it works on Desktop Chrome. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Initialize test variable Created 7 years, 9 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/file_browser/handle_mime_type/background.js
diff --git a/chrome/test/data/extensions/api_test/file_browser/handle_mime_type/background.js b/chrome/test/data/extensions/api_test/file_browser/handle_mime_type/background.js
deleted file mode 100644
index 16864b3e23967b0b1991d1320dea130088399f14..0000000000000000000000000000000000000000
--- a/chrome/test/data/extensions/api_test/file_browser/handle_mime_type/background.js
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// True iff the notifyFail has alerady been called.
-var hasFailed = false;
-
-chrome.fileBrowserHandler.onExecuteContentHandler.addListener(
- function(mime_type, content_url) {
- // The tests are setup so resources with MIME type 'application/msword' are
- // meant to be handled by the extension. The extension getting an event with
- // the MIME type 'application/msword' means the test has succeeded.
- if (mime_type == 'application/msword') {
- chrome.test.notifyPass();
- return;
- }
-
- // The tests are setup so resources with MIME type 'plain/text' are meant to
- // be handled by the browser (i.e. downloaded). The extension getting event
- // with MIME type 'plain/text' is thus a failure.
- if (mime_type == 'plain/text') {
- chrome.test.notifyFail(
- 'Unexpected request to handle "plain/text" MIME type.');
- // Set |hasFailed| so notifyPass doesn't get called later (when event with
- // MIME type 'test/done' is received).
- hasFailed = true;
- return;
- }
-
- // MIME type 'test/done' is received only when tests for which no events
- // should be raised to notify the extension it's job is done. If the extension
- // receives the 'test/done' and there were no previous failures, notify that
- // the test has succeeded.
- if (!hasFailed && mime_type == 'test/done')
- chrome.test.notifyPass();
-});

Powered by Google App Engine
This is Rietveld 408576698