| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/tab_desktop_media_list.h" | 5 #include "chrome/browser/media/tab_desktop_media_list.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 tab_strip_model->GetWebContentsAt(kDefaultSourceCount - 1); | 323 tab_strip_model->GetWebContentsAt(kDefaultSourceCount - 1); |
| 324 ASSERT_TRUE(contents); | 324 ASSERT_TRUE(contents); |
| 325 contents->GetController().GetTransientEntry()->SetTitle( | 325 contents->GetController().GetTransientEntry()->SetTitle( |
| 326 base::UTF8ToUTF16("New test tab")); | 326 base::UTF8ToUTF16("New test tab")); |
| 327 | 327 |
| 328 EXPECT_CALL(observer_, OnSourceNameChanged(list_.get(), 0)) | 328 EXPECT_CALL(observer_, OnSourceNameChanged(list_.get(), 0)) |
| 329 .WillOnce(QuitMessageLoop()); | 329 .WillOnce(QuitMessageLoop()); |
| 330 | 330 |
| 331 base::MessageLoop::current()->Run(); | 331 base::MessageLoop::current()->Run(); |
| 332 | 332 |
| 333 EXPECT_EQ(list_->GetSource(0).name, base::UTF8ToUTF16("Tab: New test tab")); | 333 EXPECT_EQ(list_->GetSource(0).name, base::UTF8ToUTF16("New test tab")); |
| 334 | 334 |
| 335 list_.reset(); | 335 list_.reset(); |
| 336 } | 336 } |
| 337 | 337 |
| 338 TEST_F(TabDesktopMediaListTest, UpdateThumbnail) { | 338 TEST_F(TabDesktopMediaListTest, UpdateThumbnail) { |
| 339 InitializeAndVerify(); | 339 InitializeAndVerify(); |
| 340 | 340 |
| 341 // Change tab's favicon. | 341 // Change tab's favicon. |
| 342 TabStripModel* tab_strip_model = browser_->tab_strip_model(); | 342 TabStripModel* tab_strip_model = browser_->tab_strip_model(); |
| 343 ASSERT_TRUE(tab_strip_model); | 343 ASSERT_TRUE(tab_strip_model); |
| 344 WebContents* contents = | 344 WebContents* contents = |
| 345 tab_strip_model->GetWebContentsAt(kDefaultSourceCount - 1); | 345 tab_strip_model->GetWebContentsAt(kDefaultSourceCount - 1); |
| 346 ASSERT_TRUE(contents); | 346 ASSERT_TRUE(contents); |
| 347 | 347 |
| 348 content::FaviconStatus favicon_info; | 348 content::FaviconStatus favicon_info; |
| 349 favicon_info.image = CreateGrayscaleImage(gfx::Size(10, 10), 100); | 349 favicon_info.image = CreateGrayscaleImage(gfx::Size(10, 10), 100); |
| 350 contents->GetController().GetTransientEntry()->GetFavicon() = favicon_info; | 350 contents->GetController().GetTransientEntry()->GetFavicon() = favicon_info; |
| 351 | 351 |
| 352 EXPECT_CALL(observer_, OnSourceThumbnailChanged(list_.get(), 0)) | 352 EXPECT_CALL(observer_, OnSourceThumbnailChanged(list_.get(), 0)) |
| 353 .WillOnce(QuitMessageLoop()); | 353 .WillOnce(QuitMessageLoop()); |
| 354 | 354 |
| 355 base::MessageLoop::current()->Run(); | 355 base::MessageLoop::current()->Run(); |
| 356 | 356 |
| 357 list_.reset(); | 357 list_.reset(); |
| 358 } | 358 } |
| OLD | NEW |