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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 ASSERT_TRUE(tab.get()); | 198 ASSERT_TRUE(tab.get()); |
199 ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(test_url)); | 199 ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(test_url)); |
200 | 200 |
201 // Wait for the test to finish. | 201 // Wait for the test to finish. |
202 ASSERT_TRUE(WaitUntilCookieValue( | 202 ASSERT_TRUE(WaitUntilCookieValue( |
203 tab.get(), test_url, "__pc_done", | 203 tab.get(), test_url, "__pc_done", |
204 TestTimeouts::large_test_timeout(), "1")); | 204 TestTimeouts::large_test_timeout(), "1")); |
205 | 205 |
206 std::string cookie; | 206 std::string cookie; |
207 ASSERT_TRUE(tab->GetCookieByName(test_url, "__pc_pages", &cookie)); | 207 ASSERT_TRUE(tab->GetCookieByName(test_url, "__pc_pages", &cookie)); |
208 pages->assign(UTF8ToWide(cookie)); | 208 pages->assign(base::UTF8ToWide(cookie)); |
209 ASSERT_FALSE(pages->empty()); | 209 ASSERT_FALSE(pages->empty()); |
210 | 210 |
211 // Wait for the report.html to be loaded. | 211 // Wait for the report.html to be loaded. |
212 ASSERT_TRUE(WaitUntilCookieValue( | 212 ASSERT_TRUE(WaitUntilCookieValue( |
213 tab.get(), test_url, "__navigated_to_report", | 213 tab.get(), test_url, "__navigated_to_report", |
214 TestTimeouts::action_max_timeout(), "1")); | 214 TestTimeouts::action_max_timeout(), "1")); |
215 | 215 |
216 // Get the timing cookie value from the DOM automation. | 216 // Get the timing cookie value from the DOM automation. |
217 std::wstring wcookie; | 217 std::wstring wcookie; |
218 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", | 218 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 void PrintMemoryHistogram(const std::string& name, | 272 void PrintMemoryHistogram(const std::string& name, |
273 const std::string& units) { | 273 const std::string& units) { |
274 scoped_refptr<TabProxy> tab(GetActiveTab()); | 274 scoped_refptr<TabProxy> tab(GetActiveTab()); |
275 ASSERT_TRUE(tab.get()); | 275 ASSERT_TRUE(tab.get()); |
276 std::wstring whistogram; | 276 std::wstring whistogram; |
277 ASSERT_TRUE(tab->ExecuteAndExtractString( | 277 ASSERT_TRUE(tab->ExecuteAndExtractString( |
278 L"", | 278 L"", |
279 L"window.domAutomationController.send(" | 279 L"window.domAutomationController.send(" |
280 L"window.domAutomationController.getHistogram ? " | 280 L"window.domAutomationController.getHistogram ? " |
281 L"window.domAutomationController.getHistogram(\"" + | 281 L"window.domAutomationController.getHistogram(\"" + |
282 base::SysUTF8ToWide(name) + L"\") : '')", | 282 base::Sysbase::UTF8ToWide(name) + L"\") : '')", |
283 &whistogram)); | 283 &whistogram)); |
284 std::string histogram = base::SysWideToNativeMB(whistogram); | 284 std::string histogram = base::SysWideToNativeMB(whistogram); |
285 printf("HISTOGRAM %s: %s = %s %s\n", | 285 printf("HISTOGRAM %s: %s = %s %s\n", |
286 name.c_str(), name.c_str(), histogram.c_str(), units.c_str()); | 286 name.c_str(), name.c_str(), histogram.c_str(), units.c_str()); |
287 } | 287 } |
288 | 288 |
289 void PrintMemoryHistograms() { | 289 void PrintMemoryHistograms() { |
290 ASSERT_NO_FATAL_FAILURE(PrintMemoryHistogram( | 290 ASSERT_NO_FATAL_FAILURE(PrintMemoryHistogram( |
291 "V8.MemoryExternalFragmentationTotal", "percent")); | 291 "V8.MemoryExternalFragmentationTotal", "percent")); |
292 ASSERT_NO_FATAL_FAILURE(PrintMemoryHistogram( | 292 ASSERT_NO_FATAL_FAILURE(PrintMemoryHistogram( |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 PAGE_CYCLER_DATABASE_TESTS("delete-transactions", | 658 PAGE_CYCLER_DATABASE_TESTS("delete-transactions", |
659 DeleteTransactions); | 659 DeleteTransactions); |
660 PAGE_CYCLER_DATABASE_TESTS("pseudo-random-transactions", | 660 PAGE_CYCLER_DATABASE_TESTS("pseudo-random-transactions", |
661 PseudoRandomTransactions); | 661 PseudoRandomTransactions); |
662 #endif | 662 #endif |
663 | 663 |
664 // Indexed DB tests. | 664 // Indexed DB tests. |
665 PAGE_CYCLER_IDB_TESTS("basic_insert", BasicInsert); | 665 PAGE_CYCLER_IDB_TESTS("basic_insert", BasicInsert); |
666 | 666 |
667 } // namespace | 667 } // namespace |
OLD | NEW |