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 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/test/thread_test_helper.h" | 9 #include "base/test/thread_test_helper.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
11 #include "chrome/browser/ui/browser_tabstrip.h" | 11 #include "chrome/browser/ui/browser_tabstrip.h" |
12 #include "chrome/test/base/in_process_browser_test.h" | 12 #include "chrome/test/base/in_process_browser_test.h" |
13 #include "chrome/test/base/testing_profile.h" | 13 #include "chrome/test/base/testing_profile.h" |
14 #include "chrome/test/base/ui_test_utils.h" | 14 #include "chrome/test/base/ui_test_utils.h" |
15 #include "content/browser/web_contents/web_contents_impl.h" | 15 #include "content/browser/web_contents/web_contents_impl.h" |
16 #include "content/public/common/content_switches.h" | 16 #include "content/public/common/content_switches.h" |
17 #include "webkit/quota/quota_manager.h" | 17 #include "webkit/quota/quota_manager.h" |
18 | 18 |
19 using content::BrowserThread; | 19 using content::BrowserThread; |
20 using quota::QuotaManager; | 20 using quota::QuotaManager; |
21 | 21 |
22 // This browser test is aimed towards exercising the FileAPI bindings and | 22 // This browser test is aimed towards exercising the FileAPI bindings and |
23 // the actual implementation that lives in the browser side. | 23 // the actual implementation that lives in the browser side. |
24 class FileSystemBrowserTest : public InProcessBrowserTest { | 24 class FileSystemBrowserTest : public InProcessBrowserTest { |
25 public: | 25 public: |
26 FileSystemBrowserTest() { | 26 FileSystemBrowserTest() {} |
27 EnableDOMAutomation(); | |
28 } | |
29 | 27 |
30 GURL testUrl(const FilePath& file_path) { | 28 GURL testUrl(const FilePath& file_path) { |
31 const FilePath kTestDir(FILE_PATH_LITERAL("fileapi")); | 29 const FilePath kTestDir(FILE_PATH_LITERAL("fileapi")); |
32 return ui_test_utils::GetTestUrl(kTestDir, file_path); | 30 return ui_test_utils::GetTestUrl(kTestDir, file_path); |
33 } | 31 } |
34 | 32 |
35 void SimpleTest(const GURL& test_url, bool incognito = false) { | 33 void SimpleTest(const GURL& test_url, bool incognito = false) { |
36 // The test page will perform tests on FileAPI, then navigate to either | 34 // The test page will perform tests on FileAPI, then navigate to either |
37 // a #pass or #fail ref. | 35 // a #pass or #fail ref. |
38 Browser* the_browser = incognito ? CreateIncognitoBrowser() : browser(); | 36 Browser* the_browser = incognito ? CreateIncognitoBrowser() : browser(); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("request_test.html")))); | 84 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("request_test.html")))); |
87 } | 85 } |
88 | 86 |
89 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTest, CreateTest) { | 87 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTest, CreateTest) { |
90 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("create_test.html")))); | 88 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("create_test.html")))); |
91 } | 89 } |
92 | 90 |
93 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTestWithLowQuota, QuotaTest) { | 91 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTestWithLowQuota, QuotaTest) { |
94 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("quota_test.html")))); | 92 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("quota_test.html")))); |
95 } | 93 } |
OLD | NEW |