OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 &FlashFullscreenInteractiveBrowserTest::CheckBitmapForFillColor, | 230 &FlashFullscreenInteractiveBrowserTest::CheckBitmapForFillColor, |
231 expected_color, | 231 expected_color, |
232 &is_expected_color, | 232 &is_expected_color, |
233 base::MessageLoop::QuitClosure()), | 233 base::MessageLoop::QuitClosure()), |
234 kN32_SkColorType); | 234 kN32_SkColorType); |
235 content::RunMessageLoop(); | 235 content::RunMessageLoop(); |
236 | 236 |
237 return is_expected_color; | 237 return is_expected_color; |
238 } | 238 } |
239 | 239 |
240 static void CheckBitmapForFillColor(SkColor expected_color, | 240 static void CheckBitmapForFillColor( |
241 bool* is_expected_color, | 241 SkColor expected_color, |
242 const base::Closure& done_cb, | 242 bool* is_expected_color, |
243 bool success, | 243 const base::Closure& done_cb, |
244 const SkBitmap& bitmap) { | 244 const SkBitmap& bitmap, |
245 if (success) { | 245 const content::ReadbackResponse& response) { |
| 246 if (response == content::READBACK_SUCCESS) { |
246 SkAutoLockPixels lock_pixels(bitmap); | 247 SkAutoLockPixels lock_pixels(bitmap); |
247 if (bitmap.width() > 0 && bitmap.height() > 0) | 248 if (bitmap.width() > 0 && bitmap.height() > 0) |
248 *is_expected_color = (bitmap.getColor(0, 0) == expected_color); | 249 *is_expected_color = (bitmap.getColor(0, 0) == expected_color); |
249 } | 250 } |
250 done_cb.Run(); | 251 done_cb.Run(); |
251 } | 252 } |
252 | 253 |
253 DISALLOW_COPY_AND_ASSIGN(FlashFullscreenInteractiveBrowserTest); | 254 DISALLOW_COPY_AND_ASSIGN(FlashFullscreenInteractiveBrowserTest); |
254 }; | 255 }; |
255 | 256 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 ASSERT_TRUE(ObserveFlashFillColor(SK_ColorRED)); | 340 ASSERT_TRUE(ObserveFlashFillColor(SK_ColorRED)); |
340 PressSpacebar(); | 341 PressSpacebar(); |
341 ASSERT_TRUE(ObserveFlashFillColor(SK_ColorBLUE)); | 342 ASSERT_TRUE(ObserveFlashFillColor(SK_ColorBLUE)); |
342 | 343 |
343 // Test that the Escape key is handled as an exit fullscreen command while the | 344 // Test that the Escape key is handled as an exit fullscreen command while the |
344 // Flash widget has the focus. | 345 // Flash widget has the focus. |
345 EXPECT_TRUE(ObserveFlashHasFocus(first_tab_contents, true)); | 346 EXPECT_TRUE(ObserveFlashHasFocus(first_tab_contents, true)); |
346 PressEscape(); | 347 PressEscape(); |
347 EXPECT_TRUE(ObserveTabIsInFullscreen(false)); | 348 EXPECT_TRUE(ObserveTabIsInFullscreen(false)); |
348 } | 349 } |
OLD | NEW |