| Index: chrome/browser/chromeos/media/media_player_browsertest.cc
|
| diff --git a/chrome/browser/ui/webui/mediaplayer_browsertest.cc b/chrome/browser/chromeos/media/media_player_browsertest.cc
|
| similarity index 69%
|
| rename from chrome/browser/ui/webui/mediaplayer_browsertest.cc
|
| rename to chrome/browser/chromeos/media/media_player_browsertest.cc
|
| index 2bd67e4cab0865bd558ee5151976e7abaf2c866c..9afaff310eaf29cae43d667b05ed9c54530d04e6 100644
|
| --- a/chrome/browser/ui/webui/mediaplayer_browsertest.cc
|
| +++ b/chrome/browser/chromeos/media/media_player_browsertest.cc
|
| @@ -5,9 +5,9 @@
|
| #include "base/command_line.h"
|
| #include "base/memory/ref_counted.h"
|
| #include "base/utf_string_conversions.h"
|
| +#include "chrome/browser/chromeos/media/media_player.h"
|
| #include "chrome/browser/ui/browser.h"
|
| #include "chrome/browser/ui/browser_list.h"
|
| -#include "chrome/browser/ui/webui/mediaplayer_ui.h"
|
| #include "chrome/common/chrome_switches.h"
|
| #include "chrome/common/url_constants.h"
|
| #include "chrome/test/automation/dom_element_proxy.h"
|
| @@ -15,8 +15,6 @@
|
| #include "chrome/test/ui_test_utils.h"
|
| #include "content/browser/tab_contents/tab_contents.h"
|
|
|
| -namespace {
|
| -
|
| class MediaPlayerBrowserTest : public InProcessBrowserTest {
|
| public:
|
| MediaPlayerBrowserTest() {}
|
| @@ -25,37 +23,23 @@ class MediaPlayerBrowserTest : public InProcessBrowserTest {
|
| return GURL("http://localhost:1337/files/plugin/sample_mp3.mp3");
|
| }
|
|
|
| - bool IsPlayerVisible() {
|
| + bool IsBrowserVisible(Browser* browser) {
|
| + if (browser == NULL)
|
| + return false;
|
| for (BrowserList::const_iterator it = BrowserList::begin();
|
| it != BrowserList::end(); ++it) {
|
| - if ((*it)->is_type_panel() && (*it)->is_app()) {
|
| - const GURL& url =
|
| - (*it)->GetTabContentsAt((*it)->active_index())->GetURL();
|
| -
|
| - if (url.SchemeIs(chrome::kChromeUIScheme) &&
|
| - url.host() == chrome::kChromeUIMediaplayerHost) {
|
| - return true;
|
| - }
|
| - }
|
| + if ((*it)->is_type_panel() && (*it)->is_app() && (*it) == browser)
|
| + return true;
|
| }
|
| return false;
|
| }
|
|
|
| + bool IsPlayerVisible() {
|
| + return IsBrowserVisible(MediaPlayer::GetInstance()->mediaplayer_browser_);
|
| + }
|
| +
|
| bool IsPlaylistVisible() {
|
| - for (BrowserList::const_iterator it = BrowserList::begin();
|
| - it != BrowserList::end(); ++it) {
|
| - if ((*it)->is_type_panel() && (*it)->is_app()) {
|
| - const GURL& url =
|
| - (*it)->GetTabContentsAt((*it)->active_index())->GetURL();
|
| -
|
| - if (url.SchemeIs(chrome::kChromeUIScheme) &&
|
| - url.host() == chrome::kChromeUIMediaplayerHost &&
|
| - url.ref() == "playlist") {
|
| - return true;
|
| - }
|
| - }
|
| - }
|
| - return false;
|
| + return IsBrowserVisible(MediaPlayer::GetInstance()->playlist_browser_);
|
| }
|
| };
|
|
|
| @@ -92,4 +76,3 @@ IN_PROC_BROWSER_TEST_F(MediaPlayerBrowserTest, PopupPlaylist) {
|
| EXPECT_TRUE(IsPlaylistVisible());
|
| }
|
|
|
| -} // namespace
|
|
|