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/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 using content::BrowserContext; | 29 using content::BrowserContext; |
30 using content::BrowserThread; | 30 using content::BrowserThread; |
31 using quota::QuotaManager; | 31 using quota::QuotaManager; |
32 using webkit_database::DatabaseUtil; | 32 using webkit_database::DatabaseUtil; |
33 | 33 |
34 // This browser test is aimed towards exercising the IndexedDB bindings and | 34 // This browser test is aimed towards exercising the IndexedDB bindings and |
35 // the actual implementation that lives in the browser side (in_process_webkit). | 35 // the actual implementation that lives in the browser side (in_process_webkit). |
36 class IndexedDBBrowserTest : public InProcessBrowserTest { | 36 class IndexedDBBrowserTest : public InProcessBrowserTest { |
37 public: | 37 public: |
38 IndexedDBBrowserTest() { | 38 IndexedDBBrowserTest() {} |
39 EnableDOMAutomation(); | |
40 } | |
41 | 39 |
42 GURL GetTestURL(const FilePath& file_path) { | 40 GURL GetTestURL(const FilePath& file_path) { |
43 FilePath dir; | 41 FilePath dir; |
44 PathService::Get(content::DIR_TEST_DATA, &dir); | 42 PathService::Get(content::DIR_TEST_DATA, &dir); |
45 return net::FilePathToFileURL( | 43 return net::FilePathToFileURL( |
46 dir.Append(FILE_PATH_LITERAL("indexeddb")).Append(file_path)); | 44 dir.Append(FILE_PATH_LITERAL("indexeddb")).Append(file_path)); |
47 } | 45 } |
48 | 46 |
49 void SimpleTest(const GURL& test_url, bool incognito = false) { | 47 void SimpleTest(const GURL& test_url, bool incognito = false) { |
50 // The test page will perform tests on IndexedDB, then navigate to either | 48 // The test page will perform tests on IndexedDB, then navigate to either |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 virtual void SetUpCommandLine(CommandLine* command_line) { | 179 virtual void SetUpCommandLine(CommandLine* command_line) { |
182 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); | 180 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); |
183 } | 181 } |
184 }; | 182 }; |
185 | 183 |
186 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithGCExposed, | 184 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithGCExposed, |
187 DatabaseCallbacksTest) { | 185 DatabaseCallbacksTest) { |
188 SimpleTest( | 186 SimpleTest( |
189 GetTestURL(FilePath(FILE_PATH_LITERAL("database_callbacks_first.html")))); | 187 GetTestURL(FilePath(FILE_PATH_LITERAL("database_callbacks_first.html")))); |
190 } | 188 } |
OLD | NEW |