| 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/file_path.h" | 5 #include "base/file_path.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/test/test_timeouts.h" | 7 #include "base/test/test_timeouts.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/common/chrome_paths.h" | 9 #include "chrome/common/chrome_paths.h" |
| 10 #include "chrome/common/automation_constants.h" | 10 #include "chrome/common/automation_constants.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 private: | 51 private: |
| 52 // Return the path to the IndexedDB test directory on the local filesystem. | 52 // Return the path to the IndexedDB test directory on the local filesystem. |
| 53 FilePath GetIndexedDBTestDir() { | 53 FilePath GetIndexedDBTestDir() { |
| 54 FilePath test_dir; | 54 FilePath test_dir; |
| 55 PathService::Get(chrome::DIR_TEST_DATA, &test_dir); | 55 PathService::Get(chrome::DIR_TEST_DATA, &test_dir); |
| 56 return test_dir.AppendASCII("indexeddb"); | 56 return test_dir.AppendASCII("indexeddb"); |
| 57 } | 57 } |
| 58 | 58 |
| 59 bool WaitUntilTestCompletes(TabProxy* tab, const GURL& test_url) { | 59 bool WaitUntilTestCompletes(TabProxy* tab, const GURL& test_url) { |
| 60 return WaitUntilCookieValue(tab, test_url, "__done", | 60 return WaitUntilCookieValue(tab, test_url, "__done", |
| 61 TestTimeouts::large_test_timeout_ms(), "1"); | 61 TestTimeouts::large_test_timeout(), "1"); |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool GetResults(TabProxy* tab, ResultsMap* results) { | 64 bool GetResults(TabProxy* tab, ResultsMap* results) { |
| 65 std::wstring json_wide; | 65 std::wstring json_wide; |
| 66 bool succeeded = tab->ExecuteAndExtractString(L"", | 66 bool succeeded = tab->ExecuteAndExtractString(L"", |
| 67 L"window.domAutomationController.send(" | 67 L"window.domAutomationController.send(" |
| 68 L" JSON.stringify(automation.getResults()));", | 68 L" JSON.stringify(automation.getResults()));", |
| 69 &json_wide); | 69 &json_wide); |
| 70 | 70 |
| 71 EXPECT_TRUE(succeeded); | 71 EXPECT_TRUE(succeeded); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 RunTest(); | 108 RunTest(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 TEST_F(IndexedDBReferenceTest, Perf) { | 111 TEST_F(IndexedDBReferenceTest, Perf) { |
| 112 | 112 |
| 113 RunTest(); | 113 RunTest(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 } // namespace | 116 } // namespace |
| OLD | NEW |