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

Unified Diff: chrome/test/data/extensions/api_test/local_filesystem/background.html

Issue 8763008: Move yet another block of tests to manifest_version 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/local_filesystem/background.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/local_filesystem/background.html
===================================================================
--- chrome/test/data/extensions/api_test/local_filesystem/background.html (revision 112170)
+++ chrome/test/data/extensions/api_test/local_filesystem/background.html (working copy)
@@ -1,63 +1,6 @@
-<script>
- var fileSystem = null;
- var testDirName = "tmp/test_dir_" + Math.floor(Math.random()*10000);
- var testFileName = "test_file_" + Math.floor(Math.random()*10000);
-
- // Get local FS, create dir with a file in it.
- console.log("Requesting local file system...");
- chrome.fileBrowserPrivate.requestLocalFileSystem(getFileSystem);
-
- function getFileSystem(fs, error) {
- if (!fs) {
- errorCallback(error);
- return;
- }
- fileSystem = fs;
- console.log("DONE requesting local filesystem: " + fileSystem.name);
- console.log("Creating directory : " + testDirName);
- fileSystem.root.getDirectory(testDirName, {create:true},
- directoryCallback, errorCallback);
- }
-
- function directoryCallback(directory) {
- console.log("DONE creating directory: " + directory.fullPath);
- directory.getFile(testFileName, {create:true}, fileCallback, errorCallback);
- }
-
- function fileCallback(file) {
- console.log("DONE creating file: " + file.fullPath);
-
- // See if we can access this filesystem and its elements in the tab.
- console.log("Opening tab...");
- chrome.tabs.create({
- url: "tab.html#" + escape(testDirName + "/" + testFileName)
- });
- }
-
-function errorCallback(e) {
- var msg = '';
- switch (e.code) {
- case FileError.QUOTA_EXCEEDED_ERR:
- msg = 'QUOTA_EXCEEDED_ERR';
- break;
- case FileError.NOT_FOUND_ERR:
- msg = 'NOT_FOUND_ERR';
- break;
- case FileError.SECURITY_ERR:
- msg = 'SECURITY_ERR';
- break;
- case FileError.INVALID_MODIFICATION_ERR:
- msg = 'INVALID_MODIFICATION_ERR';
- break;
- case FileError.INVALID_STATE_ERR:
- msg = 'INVALID_STATE_ERR';
- break;
- default:
- msg = 'Unknown Error';
- break;
- };
- chrome.test.fail("Got unexpected error: " + msg);
- console.log('Error: ' + msg);
- alert('Error: ' + msg);
-}
-</script>
+<!--
+ * Copyright (c) 2011 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.
+-->
+<script src="background.js"></script>
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/local_filesystem/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698