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

Side by Side Diff: chrome/test/perf/indexeddb_uitest.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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
« no previous file with comments | « chrome/test/perf/frame_rate/frame_rate_tests.cc ('k') | chrome/test/perf/page_cycler_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(), "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(
67 std::wstring(),
67 L"window.domAutomationController.send(" 68 L"window.domAutomationController.send("
68 L" JSON.stringify(automation.getResults()));", 69 L" JSON.stringify(automation.getResults()));",
69 &json_wide); 70 &json_wide);
70 71
71 EXPECT_TRUE(succeeded); 72 EXPECT_TRUE(succeeded);
72 if (!succeeded) 73 if (!succeeded)
73 return false; 74 return false;
74 75
75 std::string json = WideToUTF8(json_wide); 76 std::string json = WideToUTF8(json_wide);
76 return JsonDictionaryToMap(json, results); 77 return JsonDictionaryToMap(json, results);
77 } 78 }
78 79
79 void PrintResults(TabProxy* tab) { 80 void PrintResults(TabProxy* tab) {
80 ResultsMap results; 81 ResultsMap results;
81 ASSERT_TRUE(GetResults(tab, &results)); 82 ASSERT_TRUE(GetResults(tab, &results));
82 83
83 std::string trace_name = reference_ ? "t_ref" : "t"; 84 std::string trace_name = reference_ ? "t_ref" : "t";
84 85
85 ResultsMap::const_iterator it = results.begin(); 86 ResultsMap::const_iterator it = results.begin();
86 for (; it != results.end(); ++it) 87 for (; it != results.end(); ++it)
87 perf_test::PrintResultList(it->first, "", trace_name, it->second, "ms", 88 perf_test::PrintResultList(
88 false); 89 it->first, std::string(), trace_name, it->second, "ms", false);
89 } 90 }
90 91
91 DISALLOW_COPY_AND_ASSIGN(IndexedDBTest); 92 DISALLOW_COPY_AND_ASSIGN(IndexedDBTest);
92 }; 93 };
93 94
94 class IndexedDBReferenceTest : public IndexedDBTest { 95 class IndexedDBReferenceTest : public IndexedDBTest {
95 public: 96 public:
96 IndexedDBReferenceTest() : IndexedDBTest() { 97 IndexedDBReferenceTest() : IndexedDBTest() {
97 reference_ = true; 98 reference_ = true;
98 } 99 }
99 100
100 virtual void SetUp() { 101 virtual void SetUp() {
101 UseReferenceBuild(); 102 UseReferenceBuild();
102 IndexedDBTest::SetUp(); 103 IndexedDBTest::SetUp();
103 } 104 }
104 }; 105 };
105 106
106 TEST_F(IndexedDBTest, Perf) { 107 TEST_F(IndexedDBTest, Perf) {
107 108
108 RunTest(); 109 RunTest();
109 } 110 }
110 111
111 TEST_F(IndexedDBReferenceTest, Perf) { 112 TEST_F(IndexedDBReferenceTest, Perf) {
112 113
113 RunTest(); 114 RunTest();
114 } 115 }
115 116
116 } // namespace 117 } // namespace
OLDNEW
« no previous file with comments | « chrome/test/perf/frame_rate/frame_rate_tests.cc ('k') | chrome/test/perf/page_cycler_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698