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

Side by Side Diff: chrome/test/data/extensions/platform_apps/launch_application_octet_stream/test.js

Issue 224883008: Sniff MIME type for files which have unknown extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and omit binary file. Created 6 years, 8 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
« no previous file with comments | « chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 chrome.app.runtime.onLaunched.addListener(function (launchData) { 5 chrome.app.runtime.onLaunched.addListener(function (launchData) {
6 // Test that the isKioskSession field is |false| and the id and items fields 6 // Test that the isKioskSession field is |false| and the id and items fields
7 // can be read in the launch data. 7 // can be read in the launch data.
8 chrome.test.runTests([ 8 chrome.test.runTests([
9 function testFileHandler() { 9 function testFileHandler() {
10 chrome.test.assertFalse(!launchData, "No launchData"); 10 chrome.test.assertFalse(!launchData, "No launchData");
11 chrome.test.assertFalse(launchData.isKioskSession, 11 chrome.test.assertFalse(launchData.isKioskSession,
12 "launchData.isKioskSession incorrect"); 12 "launchData.isKioskSession incorrect");
13 chrome.test.assertEq(launchData.id, "unknown", 13 chrome.test.assertEq(launchData.id, "unknown",
14 "launchData.id incorrect"); 14 "launchData.id incorrect");
15 chrome.test.assertEq(launchData.items.length, 1); 15 chrome.test.assertEq(launchData.items.length, 1);
16 chrome.test.assertEq(launchData.items[0].type, 16 chrome.test.assertEq(launchData.items[0].type,
17 "application/octet-stream"); 17 "application/octet-stream");
18 chrome.test.assertTrue( 18 chrome.test.assertTrue(
19 chrome.fileSystem.retainEntry(launchData.items[0].entry) != null); 19 chrome.fileSystem.retainEntry(launchData.items[0].entry) != null);
20 20
21 launchData.items[0].entry.file(function(file) { 21 chrome.test.succeed();
22 var reader = new FileReader();
23 reader.onloadend = function(e) {
24 chrome.test.assertEq(
25 reader.result.indexOf("This is a test. Word."), 0);
26 chrome.test.succeed();
27 };
28 reader.onerror = function(e) {
29 chrome.test.fail("Error reading file contents.");
30 };
31 reader.readAsText(file);
32 });
33 } 22 }
34 ]); 23 ]);
35 }); 24 });
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698