Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/media/native_desktop_media_list.h" | 5 #include "chrome/browser/media/native_desktop_media_list.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 474 window_capturer_->SetWindowList(window_list_); | 474 window_capturer_->SetWindowList(window_list_); |
| 475 | 475 |
| 476 message_loop()->Run(); | 476 message_loop()->Run(); |
| 477 | 477 |
| 478 EXPECT_EQ(model_->GetSource(1).name, base::UTF8ToUTF16(kTestTitle)); | 478 EXPECT_EQ(model_->GetSource(1).name, base::UTF8ToUTF16(kTestTitle)); |
| 479 } | 479 } |
| 480 | 480 |
| 481 TEST_F(NativeDesktopMediaListTest, UpdateThumbnail) { | 481 TEST_F(NativeDesktopMediaListTest, UpdateThumbnail) { |
| 482 AddWindowsAndVerify(true, kDefaultWindowCount, kDefaultAuraCount, false); | 482 AddWindowsAndVerify(true, kDefaultWindowCount, kDefaultAuraCount, false); |
| 483 | 483 |
| 484 // Aura windows' thumbnails may unpredictably change overtime. | |
|
Sergey Ulanov
2016/06/08 22:18:04
nit: s/overtime/over time/
| |
| 485 for (size_t i = kDefaultWindowCount - kDefaultAuraCount; | |
| 486 i < kDefaultWindowCount; ++i) { | |
| 487 EXPECT_CALL(observer_, OnSourceThumbnailChanged(model_.get(), i + 1)) | |
| 488 .Times(testing::AnyNumber()); | |
| 489 } | |
| 490 | |
| 484 EXPECT_CALL(observer_, OnSourceThumbnailChanged(model_.get(), 1)) | 491 EXPECT_CALL(observer_, OnSourceThumbnailChanged(model_.get(), 1)) |
| 485 .WillOnce(QuitMessageLoop(message_loop())); | 492 .WillOnce(QuitMessageLoop(message_loop())); |
| 486 | 493 |
| 487 // Update frame for the window and verify that we get notification about it. | 494 // Update frame for the window and verify that we get notification about it. |
| 488 window_capturer_->SetNextFrameValue(1, 10); | 495 window_capturer_->SetNextFrameValue(1, 10); |
| 489 | 496 |
| 490 message_loop()->Run(); | 497 message_loop()->Run(); |
| 491 } | 498 } |
| 492 | 499 |
| 493 TEST_F(NativeDesktopMediaListTest, MoveWindow) { | 500 TEST_F(NativeDesktopMediaListTest, MoveWindow) { |
| 494 AddWindowsAndVerify(true, kDefaultWindowCount, kDefaultAuraCount, false); | 501 AddWindowsAndVerify(true, kDefaultWindowCount, kDefaultAuraCount, false); |
| 495 | 502 |
| 496 EXPECT_CALL(observer_, OnSourceMoved(model_.get(), 2, 1)) | 503 EXPECT_CALL(observer_, OnSourceMoved(model_.get(), 2, 1)) |
| 497 .WillOnce(DoAll(CheckListSize(model_.get(), kDefaultWindowCount + 1), | 504 .WillOnce(DoAll(CheckListSize(model_.get(), kDefaultWindowCount + 1), |
| 498 QuitMessageLoop(message_loop()))); | 505 QuitMessageLoop(message_loop()))); |
| 499 | 506 |
| 500 // Swap the two windows. | 507 // Swap the two windows. |
| 501 webrtc::WindowCapturer::Window temp = window_list_[0]; | 508 webrtc::WindowCapturer::Window temp = window_list_[0]; |
| 502 window_list_[0] = window_list_[1]; | 509 window_list_[0] = window_list_[1]; |
| 503 window_list_[1] = temp; | 510 window_list_[1] = temp; |
| 504 window_capturer_->SetWindowList(window_list_); | 511 window_capturer_->SetWindowList(window_list_); |
| 505 | 512 |
| 506 message_loop()->Run(); | 513 message_loop()->Run(); |
| 507 } | 514 } |
| OLD | NEW |