Chromium Code Reviews| 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 "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/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/test/trace_event_analyzer.h" | 10 #include "base/test/trace_event_analyzer.h" |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 #endif | 30 #endif |
| 31 | 31 |
| 32 using content::GpuDataManager; | 32 using content::GpuDataManager; |
| 33 using content::GpuFeatureType; | 33 using content::GpuFeatureType; |
| 34 using trace_analyzer::Query; | 34 using trace_analyzer::Query; |
| 35 using trace_analyzer::TraceAnalyzer; | 35 using trace_analyzer::TraceAnalyzer; |
| 36 using trace_analyzer::TraceEventVector; | 36 using trace_analyzer::TraceEventVector; |
| 37 | 37 |
| 38 namespace { | 38 namespace { |
| 39 | 39 |
| 40 typedef uint32 GpuResultFlags; | 40 #define SWAP_BUFFERS_EVENT "SwapBuffers" |
|
Alexei Svitkine (slow)
2012/09/17 20:23:47
Nit: Declare these per the Chromium style conventi
Vangelis Kokkevis
2012/09/17 21:47:54
Done.
| |
| 41 #define EXPECT_NO_GPU_SWAP_BUFFERS GpuResultFlags(1<<0) | 41 #define ACCELERATED_CANVAS_CREATION_EVENT "Canvas2DLayerBridgeCreation" |
| 42 // Expect a SwapBuffers to occur (see gles2_cmd_decoder.cc). | 42 #define WEBGL_CREATION_EVENT "DrawingBufferCreation" |
| 43 #define EXPECT_GPU_SWAP_BUFFERS GpuResultFlags(1<<1) | |
| 44 | 43 |
| 45 class GpuFeatureTest : public InProcessBrowserTest { | 44 class GpuFeatureTest : public InProcessBrowserTest { |
| 46 public: | 45 public: |
| 47 GpuFeatureTest() : trace_categories_("test_gpu"), gpu_enabled_(false) {} | 46 GpuFeatureTest() : trace_categories_("test_gpu"), gpu_enabled_(false) {} |
| 48 | 47 |
| 49 virtual void SetUpInProcessBrowserTestFixture() { | 48 virtual void SetUpInProcessBrowserTestFixture() { |
| 50 FilePath test_dir; | 49 FilePath test_dir; |
| 51 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir)); | 50 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir)); |
| 52 gpu_test_dir_ = test_dir.AppendASCII("gpu"); | 51 gpu_test_dir_ = test_dir.AppendASCII("gpu"); |
| 53 } | 52 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 browser(), net::FilePathToFileURL(test_path)); | 98 browser(), net::FilePathToFileURL(test_path)); |
| 100 } | 99 } |
| 101 | 100 |
| 102 std::string result; | 101 std::string result; |
| 103 // Wait for message indicating the test has finished running. | 102 // Wait for message indicating the test has finished running. |
| 104 ASSERT_TRUE(message_queue.WaitForMessage(&result)); | 103 ASSERT_TRUE(message_queue.WaitForMessage(&result)); |
| 105 if (expected_reply) | 104 if (expected_reply) |
| 106 EXPECT_STREQ(expected_reply, result.c_str()); | 105 EXPECT_STREQ(expected_reply, result.c_str()); |
| 107 } | 106 } |
| 108 | 107 |
| 109 void RunTest(const FilePath& url, GpuResultFlags expectations) { | 108 // Open the URL and check the trace stream for the given event. |
| 109 void RunEventTest(const FilePath& url, | |
| 110 const char* event_name = NULL, | |
| 111 bool event_expected = false) { | |
| 110 #if defined(OS_LINUX) && !defined(NDEBUG) | 112 #if defined(OS_LINUX) && !defined(NDEBUG) |
| 111 // Bypass tests on GPU Linux Debug bots. | 113 // Bypass tests on GPU Linux Debug bots. |
| 112 if (gpu_enabled_) | 114 if (gpu_enabled_) |
| 113 return; | 115 return; |
| 114 #endif | 116 #endif |
| 115 #if defined(OS_MACOSX) | 117 #if defined(OS_MACOSX) |
| 116 // Bypass tests on Mac OSX 10.5 bots (IOSurfaceSupport is now required). | 118 // Bypass tests on Mac OSX 10.5 bots (IOSurfaceSupport is now required). |
| 117 if (!IOSurfaceSupport::Initialize()) | 119 if (!IOSurfaceSupport::Initialize()) |
| 118 return; | 120 return; |
| 119 #endif | 121 #endif |
| 120 | 122 |
| 121 ASSERT_TRUE(tracing::BeginTracing(trace_categories_)); | 123 ASSERT_TRUE(tracing::BeginTracing(trace_categories_)); |
| 122 | 124 |
| 123 // Have to use a new tab for the blacklist to work. | 125 // Have to use a new tab for the blacklist to work. |
| 124 RunTest(url, NULL, true); | 126 RunTest(url, NULL, true); |
| 125 | 127 |
| 126 ASSERT_TRUE(tracing::EndTracing(&trace_events_json_)); | 128 ASSERT_TRUE(tracing::EndTracing(&trace_events_json_)); |
| 127 | 129 |
| 128 analyzer_.reset(TraceAnalyzer::Create(trace_events_json_)); | 130 analyzer_.reset(TraceAnalyzer::Create(trace_events_json_)); |
| 129 analyzer_->AssociateBeginEndEvents(); | 131 analyzer_->AssociateBeginEndEvents(); |
| 130 TraceEventVector events; | 132 TraceEventVector events; |
| 131 | 133 |
| 132 if (expectations & EXPECT_NO_GPU_SWAP_BUFFERS) { | 134 if (!event_name) |
| 133 EXPECT_EQ(analyzer_->FindEvents(Query::EventNameIs("SwapBuffers"), | 135 return; |
| 134 &events), size_t(0)); | |
| 135 } | |
| 136 | 136 |
| 137 // Check for swap buffers if expected: | 137 size_t event_count = |
| 138 if (expectations & EXPECT_GPU_SWAP_BUFFERS) { | 138 analyzer_->FindEvents(Query::EventNameIs(event_name), &events); |
| 139 EXPECT_GT(analyzer_->FindEvents(Query::EventNameIs("SwapBuffers"), | 139 |
| 140 &events), size_t(0)); | 140 if (event_expected) |
| 141 } | 141 EXPECT_GT(event_count, size_t(0)); |
|
Alexei Svitkine (slow)
2012/09/17 20:23:47
Nit: Instead of size_t(0), use 0U.
Vangelis Kokkevis
2012/09/17 21:47:54
Done.
| |
| 142 else | |
| 143 EXPECT_EQ(event_count, size_t(0)); | |
| 142 } | 144 } |
| 143 | 145 |
| 144 // Trigger a resize of the chrome window, and use tracing to wait for the | 146 // Trigger a resize of the chrome window, and use tracing to wait for the |
| 145 // given |wait_event|. | 147 // given |wait_event|. |
| 146 bool ResizeAndWait(const gfx::Rect& new_bounds, | 148 bool ResizeAndWait(const gfx::Rect& new_bounds, |
| 147 const char* trace_categories, | 149 const char* trace_categories, |
| 148 const char* wait_category, | 150 const char* wait_category, |
| 149 const char* wait_event) { | 151 const char* wait_event) { |
| 150 if (!tracing::BeginTracingWithWatch(trace_categories, wait_category, | 152 if (!tracing::BeginTracingWithWatch(trace_categories, wait_category, |
| 151 wait_event, 1)) | 153 wait_event, 1)) |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 167 std::string trace_events_json_; | 169 std::string trace_events_json_; |
| 168 bool gpu_enabled_; | 170 bool gpu_enabled_; |
| 169 }; | 171 }; |
| 170 | 172 |
| 171 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, AcceleratedCompositingAllowed) { | 173 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, AcceleratedCompositingAllowed) { |
| 172 GpuFeatureType type = | 174 GpuFeatureType type = |
| 173 GpuDataManager::GetInstance()->GetBlacklistedFeatures(); | 175 GpuDataManager::GetInstance()->GetBlacklistedFeatures(); |
| 174 EXPECT_EQ(type, 0); | 176 EXPECT_EQ(type, 0); |
| 175 | 177 |
| 176 const FilePath url(FILE_PATH_LITERAL("feature_compositing.html")); | 178 const FilePath url(FILE_PATH_LITERAL("feature_compositing.html")); |
| 177 RunTest(url, EXPECT_GPU_SWAP_BUFFERS); | 179 RunEventTest(url, SWAP_BUFFERS_EVENT, true); |
| 178 } | 180 } |
| 179 | 181 |
| 180 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, AcceleratedCompositingBlocked) { | 182 class AcceleratedCompositingBlockedTest : public GpuFeatureTest { |
| 181 const std::string json_blacklist = | 183 public: |
| 184 virtual void SetUpInProcessBrowserTestFixture() { | |
|
Alexei Svitkine (slow)
2012/09/17 20:23:47
Nit: OVERRIDE.
Vangelis Kokkevis
2012/09/17 21:47:54
Done.
| |
| 185 GpuFeatureTest::SetUpInProcessBrowserTestFixture(); | |
| 186 const std::string json_blacklist = | |
| 182 "{\n" | 187 "{\n" |
| 183 " \"name\": \"gpu blacklist\",\n" | 188 " \"name\": \"gpu blacklist\",\n" |
| 184 " \"version\": \"1.0\",\n" | 189 " \"version\": \"1.0\",\n" |
| 185 " \"entries\": [\n" | 190 " \"entries\": [\n" |
| 186 " {\n" | 191 " {\n" |
| 187 " \"id\": 1,\n" | 192 " \"id\": 1,\n" |
| 188 " \"blacklist\": [\n" | 193 " \"blacklist\": [\n" |
| 189 " \"accelerated_compositing\"\n" | 194 " \"accelerated_compositing\"\n" |
| 190 " ]\n" | 195 " ]\n" |
| 191 " }\n" | 196 " }\n" |
| 192 " ]\n" | 197 " ]\n" |
| 193 "}"; | 198 "}"; |
| 194 SetupBlacklist(json_blacklist); | 199 SetupBlacklist(json_blacklist); |
| 200 } | |
| 201 }; | |
| 202 | |
| 203 IN_PROC_BROWSER_TEST_F(AcceleratedCompositingBlockedTest, | |
| 204 AcceleratedCompositingBlocked) { | |
| 195 GpuFeatureType type = | 205 GpuFeatureType type = |
| 196 GpuDataManager::GetInstance()->GetBlacklistedFeatures(); | 206 GpuDataManager::GetInstance()->GetBlacklistedFeatures(); |
| 197 EXPECT_EQ(type, content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING); | 207 EXPECT_EQ(type, content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING); |
| 198 | 208 |
| 199 const FilePath url(FILE_PATH_LITERAL("feature_compositing.html")); | 209 const FilePath url(FILE_PATH_LITERAL("feature_compositing.html")); |
| 200 RunTest(url, EXPECT_NO_GPU_SWAP_BUFFERS); | 210 RunEventTest(url, SWAP_BUFFERS_EVENT, false); |
| 201 } | 211 } |
| 202 | 212 |
| 203 class AcceleratedCompositingTest : public GpuFeatureTest { | 213 class AcceleratedCompositingTest : public GpuFeatureTest { |
| 204 public: | 214 public: |
| 205 virtual void SetUpCommandLine(CommandLine* command_line) { | 215 virtual void SetUpCommandLine(CommandLine* command_line) { |
| 206 GpuFeatureTest::SetUpCommandLine(command_line); | 216 GpuFeatureTest::SetUpCommandLine(command_line); |
| 207 command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); | 217 command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); |
| 208 } | 218 } |
| 209 }; | 219 }; |
| 210 | 220 |
| 211 IN_PROC_BROWSER_TEST_F(AcceleratedCompositingTest, | 221 IN_PROC_BROWSER_TEST_F(AcceleratedCompositingTest, |
| 212 AcceleratedCompositingDisabled) { | 222 AcceleratedCompositingDisabled) { |
| 213 const FilePath url(FILE_PATH_LITERAL("feature_compositing.html")); | 223 const FilePath url(FILE_PATH_LITERAL("feature_compositing.html")); |
| 214 RunTest(url, EXPECT_NO_GPU_SWAP_BUFFERS); | 224 RunEventTest(url, SWAP_BUFFERS_EVENT, false); |
| 215 } | 225 } |
| 216 | 226 |
| 217 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, WebGLAllowed) { | 227 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, WebGLAllowed) { |
| 218 GpuFeatureType type = | 228 GpuFeatureType type = |
| 219 GpuDataManager::GetInstance()->GetBlacklistedFeatures(); | 229 GpuDataManager::GetInstance()->GetBlacklistedFeatures(); |
| 220 EXPECT_EQ(type, 0); | 230 EXPECT_EQ(type, 0); |
| 221 | 231 |
| 222 const FilePath url(FILE_PATH_LITERAL("feature_webgl.html")); | 232 const FilePath url(FILE_PATH_LITERAL("feature_webgl.html")); |
| 223 RunTest(url, EXPECT_GPU_SWAP_BUFFERS); | 233 RunEventTest(url, WEBGL_CREATION_EVENT, true); |
| 224 } | 234 } |
| 225 | 235 |
| 226 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, WebGLBlocked) { | 236 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, WebGLBlocked) { |
| 227 const std::string json_blacklist = | 237 const std::string json_blacklist = |
| 228 "{\n" | 238 "{\n" |
| 229 " \"name\": \"gpu blacklist\",\n" | 239 " \"name\": \"gpu blacklist\",\n" |
| 230 " \"version\": \"1.0\",\n" | 240 " \"version\": \"1.0\",\n" |
| 231 " \"entries\": [\n" | 241 " \"entries\": [\n" |
| 232 " {\n" | 242 " {\n" |
| 233 " \"id\": 1,\n" | 243 " \"id\": 1,\n" |
| 234 " \"blacklist\": [\n" | 244 " \"blacklist\": [\n" |
| 235 " \"webgl\"\n" | 245 " \"webgl\"\n" |
| 236 " ]\n" | 246 " ]\n" |
| 237 " }\n" | 247 " }\n" |
| 238 " ]\n" | 248 " ]\n" |
| 239 "}"; | 249 "}"; |
| 240 SetupBlacklist(json_blacklist); | 250 SetupBlacklist(json_blacklist); |
| 241 GpuFeatureType type = | 251 GpuFeatureType type = |
| 242 GpuDataManager::GetInstance()->GetBlacklistedFeatures(); | 252 GpuDataManager::GetInstance()->GetBlacklistedFeatures(); |
| 243 EXPECT_EQ(type, content::GPU_FEATURE_TYPE_WEBGL); | 253 EXPECT_EQ(type, content::GPU_FEATURE_TYPE_WEBGL); |
| 244 | 254 |
| 245 const FilePath url(FILE_PATH_LITERAL("feature_webgl.html")); | 255 const FilePath url(FILE_PATH_LITERAL("feature_webgl.html")); |
| 246 RunTest(url, EXPECT_NO_GPU_SWAP_BUFFERS); | 256 RunEventTest(url, WEBGL_CREATION_EVENT, false); |
| 247 } | 257 } |
| 248 | 258 |
| 249 class WebGLTest : public GpuFeatureTest { | 259 class WebGLTest : public GpuFeatureTest { |
| 250 public: | 260 public: |
| 251 virtual void SetUpCommandLine(CommandLine* command_line) { | 261 virtual void SetUpCommandLine(CommandLine* command_line) { |
| 252 GpuFeatureTest::SetUpCommandLine(command_line); | 262 GpuFeatureTest::SetUpCommandLine(command_line); |
| 253 #if !defined(OS_ANDROID) | 263 #if !defined(OS_ANDROID) |
| 254 // On Android, WebGL is disabled by default | 264 // On Android, WebGL is disabled by default |
| 255 command_line->AppendSwitch(switches::kDisableExperimentalWebGL); | 265 command_line->AppendSwitch(switches::kDisableExperimentalWebGL); |
| 256 #endif | 266 #endif |
| 257 } | 267 } |
| 258 }; | 268 }; |
| 259 | 269 |
| 260 IN_PROC_BROWSER_TEST_F(WebGLTest, WebGLDisabled) { | 270 IN_PROC_BROWSER_TEST_F(WebGLTest, WebGLDisabled) { |
| 261 const FilePath url(FILE_PATH_LITERAL("feature_webgl.html")); | 271 const FilePath url(FILE_PATH_LITERAL("feature_webgl.html")); |
| 262 RunTest(url, EXPECT_NO_GPU_SWAP_BUFFERS); | 272 RunEventTest(url, WEBGL_CREATION_EVENT, false); |
| 263 } | 273 } |
| 264 | 274 |
| 265 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, MultisamplingAllowed) { | 275 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, MultisamplingAllowed) { |
| 266 GpuFeatureType type = | 276 GpuFeatureType type = |
| 267 GpuDataManager::GetInstance()->GetBlacklistedFeatures(); | 277 GpuDataManager::GetInstance()->GetBlacklistedFeatures(); |
| 268 EXPECT_EQ(type, 0); | 278 EXPECT_EQ(type, 0); |
| 269 | 279 |
| 270 // Multisampling is not supported if running on top of osmesa. | 280 // Multisampling is not supported if running on top of osmesa. |
| 271 std::string use_gl = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 281 std::string use_gl = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 272 switches::kUseGL); | 282 switches::kUseGL); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 332 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, Canvas2DAllowed) { | 342 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, Canvas2DAllowed) { |
| 333 // Accelerated canvas 2D is not supported on XP. | 343 // Accelerated canvas 2D is not supported on XP. |
| 334 if (GPUTestBotConfig::CurrentConfigMatches("XP")) | 344 if (GPUTestBotConfig::CurrentConfigMatches("XP")) |
| 335 return; | 345 return; |
| 336 | 346 |
| 337 GpuFeatureType type = | 347 GpuFeatureType type = |
| 338 GpuDataManager::GetInstance()->GetBlacklistedFeatures(); | 348 GpuDataManager::GetInstance()->GetBlacklistedFeatures(); |
| 339 EXPECT_EQ(type, 0); | 349 EXPECT_EQ(type, 0); |
| 340 | 350 |
| 341 const FilePath url(FILE_PATH_LITERAL("feature_canvas2d.html")); | 351 const FilePath url(FILE_PATH_LITERAL("feature_canvas2d.html")); |
| 342 RunTest(url, EXPECT_GPU_SWAP_BUFFERS); | 352 RunEventTest(url, ACCELERATED_CANVAS_CREATION_EVENT, true); |
| 343 } | 353 } |
| 344 | 354 |
| 345 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, Canvas2DBlocked) { | 355 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, Canvas2DBlocked) { |
| 346 const std::string json_blacklist = | 356 const std::string json_blacklist = |
| 347 "{\n" | 357 "{\n" |
| 348 " \"name\": \"gpu blacklist\",\n" | 358 " \"name\": \"gpu blacklist\",\n" |
| 349 " \"version\": \"1.0\",\n" | 359 " \"version\": \"1.0\",\n" |
| 350 " \"entries\": [\n" | 360 " \"entries\": [\n" |
| 351 " {\n" | 361 " {\n" |
| 352 " \"id\": 1,\n" | 362 " \"id\": 1,\n" |
| 353 " \"blacklist\": [\n" | 363 " \"blacklist\": [\n" |
| 354 " \"accelerated_2d_canvas\"\n" | 364 " \"accelerated_2d_canvas\"\n" |
| 355 " ]\n" | 365 " ]\n" |
| 356 " }\n" | 366 " }\n" |
| 357 " ]\n" | 367 " ]\n" |
| 358 "}"; | 368 "}"; |
| 359 SetupBlacklist(json_blacklist); | 369 SetupBlacklist(json_blacklist); |
| 360 GpuFeatureType type = | 370 GpuFeatureType type = |
| 361 GpuDataManager::GetInstance()->GetBlacklistedFeatures(); | 371 GpuDataManager::GetInstance()->GetBlacklistedFeatures(); |
| 362 EXPECT_EQ(type, content::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS); | 372 EXPECT_EQ(type, content::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS); |
| 363 | 373 |
| 364 const FilePath url(FILE_PATH_LITERAL("feature_canvas2d.html")); | 374 const FilePath url(FILE_PATH_LITERAL("feature_canvas2d.html")); |
| 365 RunTest(url, EXPECT_NO_GPU_SWAP_BUFFERS); | 375 RunEventTest(url, ACCELERATED_CANVAS_CREATION_EVENT, false); |
| 366 } | 376 } |
| 367 | 377 |
| 368 class Canvas2DDisabledTest : public GpuFeatureTest { | 378 class Canvas2DDisabledTest : public GpuFeatureTest { |
| 369 public: | 379 public: |
| 370 virtual void SetUpCommandLine(CommandLine* command_line) { | 380 virtual void SetUpCommandLine(CommandLine* command_line) { |
| 371 GpuFeatureTest::SetUpCommandLine(command_line); | 381 GpuFeatureTest::SetUpCommandLine(command_line); |
| 372 command_line->AppendSwitch(switches::kDisableAccelerated2dCanvas); | 382 command_line->AppendSwitch(switches::kDisableAccelerated2dCanvas); |
| 373 } | 383 } |
| 374 }; | 384 }; |
| 375 | 385 |
| 376 IN_PROC_BROWSER_TEST_F(Canvas2DDisabledTest, Canvas2DDisabled) { | 386 IN_PROC_BROWSER_TEST_F(Canvas2DDisabledTest, Canvas2DDisabled) { |
| 377 const FilePath url(FILE_PATH_LITERAL("feature_canvas2d.html")); | 387 const FilePath url(FILE_PATH_LITERAL("feature_canvas2d.html")); |
| 378 RunTest(url, EXPECT_NO_GPU_SWAP_BUFFERS); | 388 RunEventTest(url, ACCELERATED_CANVAS_CREATION_EVENT, false); |
| 379 } | 389 } |
| 380 | 390 |
| 381 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, | 391 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, |
| 382 CanOpenPopupAndRenderWithWebGLCanvas) { | 392 CanOpenPopupAndRenderWithWebGLCanvas) { |
| 383 const FilePath url(FILE_PATH_LITERAL("webgl_popup.html")); | 393 const FilePath url(FILE_PATH_LITERAL("webgl_popup.html")); |
| 384 RunTest(url, "\"SUCCESS\"", false); | 394 RunTest(url, "\"SUCCESS\"", false); |
| 385 } | 395 } |
| 386 | 396 |
| 387 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, CanOpenPopupAndRenderWith2DCanvas) { | 397 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, CanOpenPopupAndRenderWith2DCanvas) { |
| 388 const FilePath url(FILE_PATH_LITERAL("canvas_popup.html")); | 398 const FilePath url(FILE_PATH_LITERAL("canvas_popup.html")); |
| 389 RunTest(url, "\"SUCCESS\"", false); | 399 RunTest(url, "\"SUCCESS\"", false); |
| 390 } | 400 } |
| 391 | 401 |
| 392 class ThreadedCompositorTest : public GpuFeatureTest { | 402 class ThreadedCompositorTest : public GpuFeatureTest { |
| 393 public: | 403 public: |
| 394 virtual void SetUpCommandLine(CommandLine* command_line) { | 404 virtual void SetUpCommandLine(CommandLine* command_line) { |
| 395 GpuFeatureTest::SetUpCommandLine(command_line); | 405 GpuFeatureTest::SetUpCommandLine(command_line); |
| 396 command_line->AppendSwitch(switches::kEnableThreadedCompositing); | 406 command_line->AppendSwitch(switches::kEnableThreadedCompositing); |
| 397 } | 407 } |
| 398 }; | 408 }; |
| 399 | 409 |
| 400 // disabled in http://crbug.com/123503 | 410 // disabled in http://crbug.com/123503 |
| 401 IN_PROC_BROWSER_TEST_F(ThreadedCompositorTest, ThreadedCompositor) { | 411 IN_PROC_BROWSER_TEST_F(ThreadedCompositorTest, ThreadedCompositor) { |
| 402 const FilePath url(FILE_PATH_LITERAL("feature_compositing.html")); | 412 const FilePath url(FILE_PATH_LITERAL("feature_compositing.html")); |
| 403 RunTest(url, EXPECT_GPU_SWAP_BUFFERS); | 413 RunEventTest(url, SWAP_BUFFERS_EVENT, true); |
| 404 } | 414 } |
| 405 | 415 |
| 406 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, RafNoDamage) { | 416 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, RafNoDamage) { |
| 407 trace_categories_ = "-test_*"; | 417 trace_categories_ = "-test_*"; |
| 408 const FilePath url(FILE_PATH_LITERAL("feature_raf_no_damage.html")); | 418 const FilePath url(FILE_PATH_LITERAL("feature_raf_no_damage.html")); |
| 409 RunTest(url, GpuResultFlags(0)); | 419 RunEventTest(url); |
| 410 | 420 |
| 411 if (!analyzer_.get()) | 421 if (!analyzer_.get()) |
| 412 return; | 422 return; |
| 413 | 423 |
| 414 // Search for matching name on begin event or async_begin event (any begin). | 424 // Search for matching name on begin event or async_begin event (any begin). |
| 415 Query query_raf = | 425 Query query_raf = |
| 416 (Query::EventPhaseIs(TRACE_EVENT_PHASE_BEGIN) || | 426 (Query::EventPhaseIs(TRACE_EVENT_PHASE_BEGIN) || |
| 417 Query::EventPhaseIs(TRACE_EVENT_PHASE_ASYNC_BEGIN)) && | 427 Query::EventPhaseIs(TRACE_EVENT_PHASE_ASYNC_BEGIN)) && |
| 418 Query::EventNameIs("___RafWithNoDamage___"); | 428 Query::EventNameIs("___RafWithNoDamage___"); |
| 419 TraceEventVector events; | 429 TraceEventVector events; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 505 base::StringPrintf( | 515 base::StringPrintf( |
| 506 "%d (resize offset %d): IOSurface width %d -> %d; Creates %d " | 516 "%d (resize offset %d): IOSurface width %d -> %d; Creates %d " |
| 507 "Expected %d", offset_i, offsets[offset_i], | 517 "Expected %d", offset_i, offsets[offset_i], |
| 508 old_width, new_width, num_creates, expected_creates); | 518 old_width, new_width, num_creates, expected_creates); |
| 509 } | 519 } |
| 510 } | 520 } |
| 511 } | 521 } |
| 512 #endif | 522 #endif |
| 513 | 523 |
| 514 } // namespace anonymous | 524 } // namespace anonymous |
| OLD | NEW |