| 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/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/test/trace_event_analyzer.h" | 9 #include "base/test/trace_event_analyzer.h" |
| 10 #include "base/version.h" | 10 #include "base/version.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 browser(), net::FilePathToFileURL(test_path), NEW_FOREGROUND_TAB, | 73 browser(), net::FilePathToFileURL(test_path), NEW_FOREGROUND_TAB, |
| 74 ui_test_utils::BROWSER_TEST_NONE); | 74 ui_test_utils::BROWSER_TEST_NONE); |
| 75 // Wait for message indicating the test has finished running. | 75 // Wait for message indicating the test has finished running. |
| 76 ASSERT_TRUE(message_queue.WaitForMessage(NULL)); | 76 ASSERT_TRUE(message_queue.WaitForMessage(NULL)); |
| 77 | 77 |
| 78 std::string json_events; | 78 std::string json_events; |
| 79 ASSERT_TRUE(tracing::EndTracing(&json_events)); | 79 ASSERT_TRUE(tracing::EndTracing(&json_events)); |
| 80 | 80 |
| 81 scoped_ptr<TraceAnalyzer> analyzer(TraceAnalyzer::Create(json_events)); | 81 scoped_ptr<TraceAnalyzer> analyzer(TraceAnalyzer::Create(json_events)); |
| 82 analyzer->AssociateBeginEndEvents(); | 82 analyzer->AssociateBeginEndEvents(); |
| 83 TraceAnalyzer::TraceEventVector events; | 83 TraceEventVector events; |
| 84 | 84 |
| 85 size_t num_gpu_processes = (expectations & EXPECT_GPU_PROCESS) ? 1 : 0; | 85 size_t num_gpu_processes = (expectations & EXPECT_GPU_PROCESS) ? 1 : 0; |
| 86 analyzer->FindEvents(Query::MatchBeginName("OnGraphicsInfoCollected"), | 86 analyzer->FindEvents(Query::MatchBeginName("OnGraphicsInfoCollected"), |
| 87 &events); | 87 &events); |
| 88 EXPECT_EQ(num_gpu_processes, events.size()); | 88 EXPECT_EQ(num_gpu_processes, events.size()); |
| 89 | 89 |
| 90 // Check for context creation if expected: | 90 // Check for context creation if expected: |
| 91 if (expectations & EXPECT_GPU_CONTEXTS) { | 91 if (expectations & EXPECT_GPU_CONTEXTS) { |
| 92 analyzer->FindEvents( | 92 analyzer->FindEvents( |
| 93 Query(EVENT_NAME) == Query::String("TryCreateGLContext"), | 93 Query(EVENT_NAME) == Query::String("TryCreateGLContext"), |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 EXPECT_EQ( | 221 EXPECT_EQ( |
| 222 flags.flags(), | 222 flags.flags(), |
| 223 static_cast<uint32>(GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas)); | 223 static_cast<uint32>(GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas)); |
| 224 | 224 |
| 225 const FilePath url(FILE_PATH_LITERAL("feature_canvas2d.html")); | 225 const FilePath url(FILE_PATH_LITERAL("feature_canvas2d.html")); |
| 226 RunTest(url, EXPECT_NO_GPU_PROCESS); | 226 RunTest(url, EXPECT_NO_GPU_PROCESS); |
| 227 } | 227 } |
| 228 | 228 |
| 229 } // namespace anonymous | 229 } // namespace anonymous |
| 230 | 230 |
| OLD | NEW |