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/files/file_path.h" | 5 #include "base/files/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/automation_constants.h" | 9 #include "chrome/common/automation_constants.h" |
10 #include "chrome/common/chrome_paths.h" | 10 #include "chrome/common/chrome_paths.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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); |
72 if (!succeeded) | 72 if (!succeeded) |
73 return false; | 73 return false; |
74 | 74 |
75 std::string json = WideToUTF8(json_wide); | 75 std::string json = base::WideToUTF8(json_wide); |
76 return JsonDictionaryToMap(json, results); | 76 return JsonDictionaryToMap(json, results); |
77 } | 77 } |
78 | 78 |
79 void PrintResults(TabProxy* tab) { | 79 void PrintResults(TabProxy* tab) { |
80 ResultsMap results; | 80 ResultsMap results; |
81 ASSERT_TRUE(GetResults(tab, &results)); | 81 ASSERT_TRUE(GetResults(tab, &results)); |
82 | 82 |
83 std::string trace_name = reference_ ? "t_ref" : "t"; | 83 std::string trace_name = reference_ ? "t_ref" : "t"; |
84 | 84 |
85 ResultsMap::const_iterator it = results.begin(); | 85 ResultsMap::const_iterator it = results.begin(); |
(...skipping 21 matching lines...) Expand all 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 |