| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
| 10 #include "base/test/thread_test_helper.h" | 10 #include "base/test/thread_test_helper.h" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
| 13 #include "chrome/test/base/in_process_browser_test.h" | 13 #include "chrome/test/base/in_process_browser_test.h" |
| 14 #include "chrome/test/base/testing_profile.h" | 14 #include "chrome/test/base/testing_profile.h" |
| 15 #include "chrome/test/base/ui_test_utils.h" | 15 #include "chrome/test/base/ui_test_utils.h" |
| 16 #include "content/browser/in_process_webkit/indexed_db_context.h" | 16 #include "content/browser/in_process_webkit/indexed_db_context.h" |
| 17 #include "content/browser/in_process_webkit/webkit_context.h" | 17 #include "content/browser/in_process_webkit/webkit_context.h" |
| 18 #include "content/browser/tab_contents/tab_contents.h" | 18 #include "content/browser/tab_contents/tab_contents.h" |
| 19 #include "content/common/content_switches.h" | 19 #include "content/common/content_switches.h" |
| 20 | 20 |
| 21 // This browser test is aimed towards exercising the IndexedDB bindings and | 21 // This browser test is aimed towards exercising the IndexedDB bindings and |
| 22 // the actual implementation that lives in the browser side (in_process_webkit). | 22 // the actual implementation that lives in the browser side (in_process_webkit). |
| 23 class IndexedDBBrowserTest : public InProcessBrowserTest { | 23 class IndexedDBBrowserTest : public InProcessBrowserTest { |
| 24 public: | 24 public: |
| 25 IndexedDBBrowserTest() { | 25 IndexedDBBrowserTest() { |
| 26 EnableDOMAutomation(); | 26 EnableDOMAutomation(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 virtual void SetUpCommandLine(CommandLine* command_line) { | |
| 30 command_line->AppendSwitch(switches::kUnlimitedQuotaForIndexedDB); | |
| 31 } | |
| 32 | |
| 33 GURL testUrl(const FilePath& file_path) { | 29 GURL testUrl(const FilePath& file_path) { |
| 34 const FilePath kTestDir(FILE_PATH_LITERAL("indexeddb")); | 30 const FilePath kTestDir(FILE_PATH_LITERAL("indexeddb")); |
| 35 return ui_test_utils::GetTestUrl(kTestDir, file_path); | 31 return ui_test_utils::GetTestUrl(kTestDir, file_path); |
| 36 } | 32 } |
| 37 | 33 |
| 38 void SimpleTest(const GURL& test_url, bool incognito = false) { | 34 void SimpleTest(const GURL& test_url, bool incognito = false) { |
| 39 // The test page will perform tests on IndexedDB, then navigate to either | 35 // The test page will perform tests on IndexedDB, then navigate to either |
| 40 // a #pass or #fail ref. | 36 // a #pass or #fail ref. |
| 41 Browser* the_browser = incognito ? CreateIncognitoBrowser() : browser(); | 37 Browser* the_browser = incognito ? CreateIncognitoBrowser() : browser(); |
| 42 | 38 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 virtual void SetUpCommandLine(CommandLine* command_line) { | 159 virtual void SetUpCommandLine(CommandLine* command_line) { |
| 164 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); | 160 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); |
| 165 } | 161 } |
| 166 }; | 162 }; |
| 167 | 163 |
| 168 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithGCExposed, | 164 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithGCExposed, |
| 169 DatabaseCallbacksTest) { | 165 DatabaseCallbacksTest) { |
| 170 SimpleTest( | 166 SimpleTest( |
| 171 testUrl(FilePath(FILE_PATH_LITERAL("database_callbacks_first.html")))); | 167 testUrl(FilePath(FILE_PATH_LITERAL("database_callbacks_first.html")))); |
| 172 } | 168 } |
| OLD | NEW |