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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 browser(), net::FilePathToFileURL(test_path), NEW_FOREGROUND_TAB, | 68 browser(), net::FilePathToFileURL(test_path), NEW_FOREGROUND_TAB, |
69 ui_test_utils::BROWSER_TEST_NONE); | 69 ui_test_utils::BROWSER_TEST_NONE); |
70 // Wait for message indicating the test has finished running. | 70 // Wait for message indicating the test has finished running. |
71 ASSERT_TRUE(message_queue.WaitForMessage(NULL)); | 71 ASSERT_TRUE(message_queue.WaitForMessage(NULL)); |
72 | 72 |
73 std::string json_events; | 73 std::string json_events; |
74 ASSERT_TRUE(tracing::EndTracing(&json_events)); | 74 ASSERT_TRUE(tracing::EndTracing(&json_events)); |
75 | 75 |
76 scoped_ptr<TraceAnalyzer> analyzer(TraceAnalyzer::Create(json_events)); | 76 scoped_ptr<TraceAnalyzer> analyzer(TraceAnalyzer::Create(json_events)); |
77 analyzer->AssociateBeginEndEvents(); | 77 analyzer->AssociateBeginEndEvents(); |
78 TraceAnalyzer::TraceEventVector events; | 78 TraceEventVector events; |
79 | 79 |
80 // This measurement is flaky, because the GPU process is sometimes | 80 // This measurement is flaky, because the GPU process is sometimes |
81 // started before the test (always with force-compositing-mode on CrOS). | 81 // started before the test (always with force-compositing-mode on CrOS). |
82 if (expectations & EXPECT_NO_GPU_PROCESS) { | 82 if (expectations & EXPECT_NO_GPU_PROCESS) { |
83 EXPECT_EQ(0u, analyzer->FindEvents( | 83 EXPECT_EQ(0u, analyzer->FindEvents( |
84 Query::MatchBeginName("OnGraphicsInfoCollected"), &events)); | 84 Query::MatchBeginName("OnGraphicsInfoCollected"), &events)); |
85 } | 85 } |
86 | 86 |
87 // Check for swap buffers if expected: | 87 // Check for swap buffers if expected: |
88 if (expectations & EXPECT_GPU_SWAP_BUFFERS) { | 88 if (expectations & EXPECT_GPU_SWAP_BUFFERS) { |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 EXPECT_EQ( | 188 EXPECT_EQ( |
189 flags.flags(), | 189 flags.flags(), |
190 static_cast<uint32>(GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas)); | 190 static_cast<uint32>(GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas)); |
191 | 191 |
192 const FilePath url(FILE_PATH_LITERAL("feature_canvas2d.html")); | 192 const FilePath url(FILE_PATH_LITERAL("feature_canvas2d.html")); |
193 RunTest(url, EXPECT_NO_GPU_PROCESS); | 193 RunTest(url, EXPECT_NO_GPU_PROCESS); |
194 } | 194 } |
195 | 195 |
196 } // namespace anonymous | 196 } // namespace anonymous |
197 | 197 |
OLD | NEW |