| 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 <stdio.h> | 5 #include <stdio.h> |
| 6 #include <cmath> | 6 #include <cmath> |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include <GLES2/gl2.h> | 10 #include <GLES2/gl2.h> |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 std::string json_data = "["; | 106 std::string json_data = "["; |
| 107 base::debug::TraceLog::GetInstance()->SetDisabled(); | 107 base::debug::TraceLog::GetInstance()->SetDisabled(); |
| 108 base::RunLoop run_loop; | 108 base::RunLoop run_loop; |
| 109 base::debug::TraceLog::GetInstance()->Flush( | 109 base::debug::TraceLog::GetInstance()->Flush( |
| 110 base::Bind(&GLHelperTest::TraceDataCB, | 110 base::Bind(&GLHelperTest::TraceDataCB, |
| 111 run_loop.QuitClosure(), | 111 run_loop.QuitClosure(), |
| 112 base::Unretained(&json_data))); | 112 base::Unretained(&json_data))); |
| 113 run_loop.Run(); | 113 run_loop.Run(); |
| 114 json_data.append("]"); | 114 json_data.append("]"); |
| 115 | 115 |
| 116 scoped_ptr<Value> trace_data(base::JSONReader::Read(json_data)); | 116 scoped_ptr<base::Value> trace_data(base::JSONReader::Read(json_data)); |
| 117 ListValue* list; | 117 base::ListValue* list; |
| 118 CHECK(trace_data->GetAsList(&list)); | 118 CHECK(trace_data->GetAsList(&list)); |
| 119 for (size_t i = 0; i < list->GetSize(); i++) { | 119 for (size_t i = 0; i < list->GetSize(); i++) { |
| 120 base::Value *item = NULL; | 120 base::Value *item = NULL; |
| 121 if (list->Get(i, &item)) { | 121 if (list->Get(i, &item)) { |
| 122 base::DictionaryValue *dict; | 122 base::DictionaryValue *dict; |
| 123 CHECK(item->GetAsDictionary(&dict)); | 123 CHECK(item->GetAsDictionary(&dict)); |
| 124 std::string name; | 124 std::string name; |
| 125 CHECK(dict->GetString("name", &name)); | 125 CHECK(dict->GetString("name", &name)); |
| 126 (*event_counts)[name]++; | 126 (*event_counts)[name]++; |
| 127 VLOG(1) << "trace name: " << name; | 127 VLOG(1) << "trace name: " << name; |
| (...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1384 #if defined(TOOLKIT_GTK) | 1384 #if defined(TOOLKIT_GTK) |
| 1385 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); | 1385 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); |
| 1386 #endif | 1386 #endif |
| 1387 gfx::GLSurface::InitializeOneOff(); | 1387 gfx::GLSurface::InitializeOneOff(); |
| 1388 gpu::ApplyGpuDriverBugWorkarounds(CommandLine::ForCurrentProcess()); | 1388 gpu::ApplyGpuDriverBugWorkarounds(CommandLine::ForCurrentProcess()); |
| 1389 | 1389 |
| 1390 content::UnitTestTestSuite runner(suite); | 1390 content::UnitTestTestSuite runner(suite); |
| 1391 base::MessageLoop message_loop; | 1391 base::MessageLoop message_loop; |
| 1392 return runner.Run(); | 1392 return runner.Run(); |
| 1393 } | 1393 } |
| OLD | NEW |