| 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/location.h" | 7 #include "base/location.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 | 275 |
| 276 return is_expected_color; | 276 return is_expected_color; |
| 277 } | 277 } |
| 278 | 278 |
| 279 static void CheckBitmapForFillColor(SkColor expected_color, | 279 static void CheckBitmapForFillColor(SkColor expected_color, |
| 280 bool* is_expected_color, | 280 bool* is_expected_color, |
| 281 const base::Closure& done_cb, | 281 const base::Closure& done_cb, |
| 282 const SkBitmap& bitmap, | 282 const SkBitmap& bitmap, |
| 283 content::ReadbackResponse response) { | 283 content::ReadbackResponse response) { |
| 284 if (response == content::READBACK_SUCCESS) { | 284 if (response == content::READBACK_SUCCESS) { |
| 285 SkAutoLockPixels lock_pixels(bitmap); | |
| 286 if (bitmap.width() > 0 && bitmap.height() > 0) | 285 if (bitmap.width() > 0 && bitmap.height() > 0) |
| 287 *is_expected_color = (bitmap.getColor(0, 0) == expected_color); | 286 *is_expected_color = (bitmap.getColor(0, 0) == expected_color); |
| 288 } | 287 } |
| 289 done_cb.Run(); | 288 done_cb.Run(); |
| 290 } | 289 } |
| 291 | 290 |
| 292 DISALLOW_COPY_AND_ASSIGN(FlashFullscreenInteractiveBrowserTest); | 291 DISALLOW_COPY_AND_ASSIGN(FlashFullscreenInteractiveBrowserTest); |
| 293 }; | 292 }; |
| 294 | 293 |
| 295 // Tests that launching and exiting fullscreen-within-tab works. | 294 // Tests that launching and exiting fullscreen-within-tab works. |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 // Make sure that the fullscreen widget got the mouse lock. | 432 // Make sure that the fullscreen widget got the mouse lock. |
| 434 EXPECT_TRUE(fullscreen_view->IsMouseLocked()); | 433 EXPECT_TRUE(fullscreen_view->IsMouseLocked()); |
| 435 EXPECT_EQ(fullscreen_widget, content::GetMouseLockWidget(web_contents)); | 434 EXPECT_EQ(fullscreen_widget, content::GetMouseLockWidget(web_contents)); |
| 436 | 435 |
| 437 PressEscape(); | 436 PressEscape(); |
| 438 EXPECT_TRUE(ObserveTabIsInFullscreen(false)); | 437 EXPECT_TRUE(ObserveTabIsInFullscreen(false)); |
| 439 | 438 |
| 440 // Mouse should be unlocked. | 439 // Mouse should be unlocked. |
| 441 EXPECT_EQ(nullptr, content::GetMouseLockWidget(web_contents)); | 440 EXPECT_EQ(nullptr, content::GetMouseLockWidget(web_contents)); |
| 442 } | 441 } |
| OLD | NEW |