OLD | NEW |
---|---|
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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 | 114 |
115 DISALLOW_COPY_AND_ASSIGN(SunSpiderTest); | 115 DISALLOW_COPY_AND_ASSIGN(SunSpiderTest); |
116 }; | 116 }; |
117 | 117 |
118 class SunSpiderReferenceTest : public SunSpiderTest { | 118 class SunSpiderReferenceTest : public SunSpiderTest { |
119 public: | 119 public: |
120 SunSpiderReferenceTest() : SunSpiderTest() { | 120 SunSpiderReferenceTest() : SunSpiderTest() { |
121 reference_ = true; | 121 reference_ = true; |
122 } | 122 } |
123 | 123 |
124 // Override the browser directory that is used by UITest::SetUp to cause it | |
125 // to use the reference build instead. | |
126 void SetUp() { | 124 void SetUp() { |
127 FilePath dir; | 125 UIPerfTest::UseReferenceBuild(); |
cmp
2011/06/16 23:29:40
just UseReferenceBuild();
| |
128 PathService::Get(chrome::DIR_TEST_TOOLS, &dir); | |
129 dir = dir.AppendASCII("reference_build"); | |
130 #if defined(OS_WIN) | |
131 dir = dir.AppendASCII("chrome"); | |
132 #elif defined(OS_LINUX) | |
133 dir = dir.AppendASCII("chrome_linux"); | |
134 #elif defined(OS_MACOSX) | |
135 dir = dir.AppendASCII("chrome_mac"); | |
136 #endif | |
137 browser_directory_ = dir; | |
138 UITest::SetUp(); | 126 UITest::SetUp(); |
139 } | 127 } |
140 }; | 128 }; |
141 | 129 |
142 TEST_F(SunSpiderTest, Perf) { | 130 TEST_F(SunSpiderTest, Perf) { |
143 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunSunSpider)) | 131 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunSunSpider)) |
144 return; | 132 return; |
145 | 133 |
146 RunTest(); | 134 RunTest(); |
147 } | 135 } |
148 | 136 |
149 TEST_F(SunSpiderReferenceTest, Perf) { | 137 TEST_F(SunSpiderReferenceTest, Perf) { |
150 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunSunSpider)) | 138 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunSunSpider)) |
151 return; | 139 return; |
152 | 140 |
153 RunTest(); | 141 RunTest(); |
154 } | 142 } |
155 | 143 |
156 } // namespace | 144 } // namespace |
OLD | NEW |