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

Side by Side Diff: cc/layer_tree_host_perftest.cc

Issue 11412289: Basic pixel tests for cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix AtExitManager registration stuff Created 8 years 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 | « cc/gl_renderer_pixeltest.cc ('k') | cc/test/DEPS » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "cc/layer_tree_host.h" 5 #include "cc/layer_tree_host.h"
6 6
7 #include "base/base_paths.h"
8 #include "base/file_path.h" 7 #include "base/file_path.h"
9 #include "base/file_util.h" 8 #include "base/file_util.h"
10 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
11 #include "base/path_service.h" 10 #include "base/path_service.h"
12 #include "base/string_piece.h" 11 #include "base/string_piece.h"
13 #include "cc/content_layer.h" 12 #include "cc/content_layer.h"
14 #include "cc/nine_patch_layer.h" 13 #include "cc/nine_patch_layer.h"
15 #include "cc/solid_color_layer.h" 14 #include "cc/solid_color_layer.h"
16 #include "cc/test/fake_content_layer_client.h" 15 #include "cc/test/fake_content_layer_client.h"
17 #include "cc/test/layer_tree_test_common.h" 16 #include "cc/test/layer_tree_test_common.h"
17 #include "cc/test/paths.h"
18 18
19 namespace cc { 19 namespace cc {
20 namespace { 20 namespace {
21 21
22 static const int kTimeLimitMillis = 2000; 22 static const int kTimeLimitMillis = 2000;
23 23
24 class LayerTreeHostPerfTest : public WebKitTests::ThreadedTest { 24 class LayerTreeHostPerfTest : public WebKitTests::ThreadedTest {
25 public: 25 public:
26 LayerTreeHostPerfTest() 26 LayerTreeHostPerfTest()
27 : num_draws_(0) { 27 : num_draws_(0) {
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 } 233 }
234 234
235 class LayerTreeHostPerfTestJsonReader : public LayerTreeHostPerfTest { 235 class LayerTreeHostPerfTestJsonReader : public LayerTreeHostPerfTest {
236 public: 236 public:
237 LayerTreeHostPerfTestJsonReader() 237 LayerTreeHostPerfTestJsonReader()
238 : LayerTreeHostPerfTest() { 238 : LayerTreeHostPerfTest() {
239 } 239 }
240 240
241 void readTestFile(std::string name) { 241 void readTestFile(std::string name) {
242 test_name_ = name; 242 test_name_ = name;
243 FilePath filepath; 243 FilePath test_data_dir;
244 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &filepath)); 244 ASSERT_TRUE(PathService::Get(cc::test::DIR_TEST_DATA, &test_data_dir));
245 filepath = filepath.AppendASCII("cc").AppendASCII("test") 245 FilePath json_file = test_data_dir.AppendASCII(name + ".json");
246 .AppendASCII("data").AppendASCII(name + ".json");
247 std::string json; 246 std::string json;
248 ASSERT_TRUE(file_util::ReadFileToString(filepath, &json)); 247 ASSERT_TRUE(file_util::ReadFileToString(json_file, &json));
249 tree_.reset(base::JSONReader::Read(json)); 248 tree_.reset(base::JSONReader::Read(json));
250 ASSERT_TRUE(tree_); 249 ASSERT_TRUE(tree_);
251 } 250 }
252 251
253 scoped_refptr<Layer> parseLayer(base::Value* val) { 252 scoped_refptr<Layer> parseLayer(base::Value* val) {
254 DictionaryValue* dict; 253 DictionaryValue* dict;
255 bool success = true; 254 bool success = true;
256 success &= val->GetAsDictionary(&dict); 255 success &= val->GetAsDictionary(&dict);
257 std::string layer_type; 256 std::string layer_type;
258 success &= dict->GetString("LayerType", &layer_type); 257 success &= dict->GetString("LayerType", &layer_type);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 scoped_ptr<base::Value> tree_; 317 scoped_ptr<base::Value> tree_;
319 }; 318 };
320 319
321 TEST_F(LayerTreeHostPerfTestJsonReader, tenTenSingleThread) { 320 TEST_F(LayerTreeHostPerfTestJsonReader, tenTenSingleThread) {
322 readTestFile("10_10_layer_tree"); 321 readTestFile("10_10_layer_tree");
323 runTest(false); 322 runTest(false);
324 } 323 }
325 324
326 } // namespace 325 } // namespace
327 } // namespace cc 326 } // namespace cc
OLDNEW
« no previous file with comments | « cc/gl_renderer_pixeltest.cc ('k') | cc/test/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698