Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(364)

Side by Side Diff: chrome/test/page_cycler/page_cycler_test.cc

Issue 6312154: Remove wstring from RVH's run Javascript command.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/basictypes.h" 5 #include "base/basictypes.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/path_service.h" 9 #include "base/path_service.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 ASSERT_TRUE(WaitUntilCookieValue( 243 ASSERT_TRUE(WaitUntilCookieValue(
244 tab.get(), test_url, "__pc_done", 244 tab.get(), test_url, "__pc_done",
245 TestTimeouts::huge_test_timeout_ms(), "1")); 245 TestTimeouts::huge_test_timeout_ms(), "1"));
246 246
247 std::string cookie; 247 std::string cookie;
248 ASSERT_TRUE(tab->GetCookieByName(test_url, "__pc_pages", &cookie)); 248 ASSERT_TRUE(tab->GetCookieByName(test_url, "__pc_pages", &cookie));
249 pages->assign(UTF8ToWide(cookie)); 249 pages->assign(UTF8ToWide(cookie));
250 ASSERT_FALSE(pages->empty()); 250 ASSERT_FALSE(pages->empty());
251 251
252 // Get the timing cookie value from the DOM automation. 252 // Get the timing cookie value from the DOM automation.
253 std::wstring wcookie; 253 string16 cookie16;
254 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", 254 ASSERT_TRUE(tab->ExecuteAndExtractString(
255 L"window.domAutomationController.send(" 255 string16(),
256 L"JSON.stringify(__get_timings()));", 256 ASCIIToUTF16("window.domAutomationController.send("
257 &wcookie)); 257 "JSON.stringify(__get_timings()));"),
258 cookie = base::SysWideToNativeMB(wcookie); 258 &cookie16));
259 cookie = base::SysWideToNativeMB(UTF16ToWide(cookie16));
259 260
260 // JSON.stringify() encapsulates the returned string in quotes, strip them. 261 // JSON.stringify() encapsulates the returned string in quotes, strip them.
261 std::string::size_type start_idx = cookie.find("\""); 262 std::string::size_type start_idx = cookie.find("\"");
262 std::string::size_type end_idx = cookie.find_last_of("\""); 263 std::string::size_type end_idx = cookie.find_last_of("\"");
263 if (start_idx != std::string::npos && 264 if (start_idx != std::string::npos &&
264 end_idx != std::string::npos && 265 end_idx != std::string::npos &&
265 start_idx < end_idx) { 266 start_idx < end_idx) {
266 cookie = cookie.substr(start_idx+1, end_idx-start_idx-1); 267 cookie = cookie.substr(start_idx+1, end_idx-start_idx-1);
267 } 268 }
268 269
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 PAGE_CYCLER_DATABASE_TESTS("delete-transactions", 589 PAGE_CYCLER_DATABASE_TESTS("delete-transactions",
589 DeleteTransactions); 590 DeleteTransactions);
590 PAGE_CYCLER_DATABASE_TESTS("pseudo-random-transactions", 591 PAGE_CYCLER_DATABASE_TESTS("pseudo-random-transactions",
591 PseudoRandomTransactions); 592 PseudoRandomTransactions);
592 #endif 593 #endif
593 594
594 // Indexed DB tests. 595 // Indexed DB tests.
595 PAGE_CYCLER_IDB_TESTS("basic_insert", BasicInsert); 596 PAGE_CYCLER_IDB_TESTS("basic_insert", BasicInsert);
596 597
597 } // namespace 598 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698