| OLD | NEW |
| 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 // This test file checks if we can read the expected contents | 5 // This test file checks if we can read the expected contents |
| 6 // (kExpectedContents) from the target file (kFileName). What's | 6 // (kExpectedContents) from the target file (kFileName). What's |
| 7 // interesting is that we'll read the file via a remote mount point. | 7 // interesting is that we'll read the file via a remote mount point. |
| 8 // See extension_local_filesystem_apitest.cc for how this is set up. | 8 // See extension_local_filesystem_apitest.cc for how this is set up. |
| 9 | 9 |
| 10 // These should match the counterparts in | 10 // These should match the counterparts in |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 msg = 'INVALID_STATE_ERR'; | 67 msg = 'INVALID_STATE_ERR'; |
| 68 break; | 68 break; |
| 69 default: | 69 default: |
| 70 msg = 'Unknown Error'; | 70 msg = 'Unknown Error'; |
| 71 break; | 71 break; |
| 72 }; | 72 }; |
| 73 } | 73 } |
| 74 chrome.test.fail(msg); | 74 chrome.test.fail(msg); |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 function getDirFromLocationHref() { |
| 78 var loc = window.location.href; |
| 79 console.log("Opening tab " + loc); |
| 80 if (loc.indexOf("#") == -1 ) { |
| 81 console.log("No params in url, faling back to default."); |
| 82 return "tmp"; |
| 83 } |
| 84 |
| 85 loc = unescape(loc.substr(loc.indexOf("#") + 1)); |
| 86 return (loc[0] == '/') ? loc.substring(1) : loc; |
| 87 } |
| 88 |
| 77 function TestRunner() { | 89 function TestRunner() { |
| 78 this.fileCreator_ = new TestFileCreator('tmp', | 90 this.fileCreator_ = new TestFileCreator(getDirFromLocationHref(), |
| 79 false /* shouldRandomize */); | 91 false /* shouldRandomize */); |
| 80 } | 92 } |
| 81 | 93 |
| 82 chrome.test.runTests([function tab() { | 94 chrome.test.runTests([function tab() { |
| 83 var testRunner = new TestRunner(); | 95 var testRunner = new TestRunner(); |
| 84 testRunner.runTest(); | 96 testRunner.runTest(); |
| 85 }]); | 97 }]); |
| OLD | NEW |