| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/time.h" | 8 #include "base/time.h" |
| 9 #include "chrome/browser/ui/ash/launcher/browser_launcher_item_controller.h" | 9 #include "chrome/browser/ui/ash/launcher/browser_launcher_item_controller.h" |
| 10 #include "chrome/browser/ui/ash/launcher/launcher_favicon_loader.h" | 10 #include "chrome/browser/ui/ash/launcher/launcher_favicon_loader.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 std::string url_path = base::StringPrintf("files/ash/launcher/%s", url); | 77 std::string url_path = base::StringPrintf("files/ash/launcher/%s", url); |
| 78 ui_test_utils::NavigateToURL(browser, test_server()->GetURL(url_path)); | 78 ui_test_utils::NavigateToURL(browser, test_server()->GetURL(url_path)); |
| 79 } | 79 } |
| 80 | 80 |
| 81 Browser* GetPanelBrowser() { | 81 Browser* GetPanelBrowser() { |
| 82 if (!panel_browser_) { | 82 if (!panel_browser_) { |
| 83 panel_browser_ = new Browser(Browser::CreateParams::CreateForApp( | 83 panel_browser_ = new Browser(Browser::CreateParams::CreateForApp( |
| 84 Browser::TYPE_PANEL, "Test Panel", gfx::Rect(), | 84 Browser::TYPE_PANEL, "Test Panel", gfx::Rect(), |
| 85 browser()->profile())); | 85 browser()->profile())); |
| 86 EXPECT_TRUE(panel_browser_->is_type_panel()); | 86 EXPECT_TRUE(panel_browser_->is_type_panel()); |
| 87 // Load initial tab contents before setting the observer. | 87 // Load initial web contents before setting the observer. |
| 88 ui_test_utils::NavigateToURL(panel_browser_, GURL()); | 88 ui_test_utils::NavigateToURL(panel_browser_, GURL()); |
| 89 EXPECT_FALSE(contents_observer_.get()); | 89 EXPECT_FALSE(contents_observer_.get()); |
| 90 contents_observer_.reset( | 90 contents_observer_.reset( |
| 91 new ContentsObserver(chrome::GetWebContentsAt(panel_browser_, 0))); | 91 new ContentsObserver(chrome::GetWebContentsAt(panel_browser_, 0))); |
| 92 } | 92 } |
| 93 return panel_browser_; | 93 return panel_browser_; |
| 94 } | 94 } |
| 95 | 95 |
| 96 LauncherFaviconLoader* GetFaviconLoader() { | 96 LauncherFaviconLoader* GetFaviconLoader() { |
| 97 if (!loader_) { | 97 if (!loader_) { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 NavigateTo("launcher-smallfavicon.html"); | 188 NavigateTo("launcher-smallfavicon.html"); |
| 189 EXPECT_TRUE(WaitForFaviconDownloads()); | 189 EXPECT_TRUE(WaitForFaviconDownloads()); |
| 190 EXPECT_TRUE(favicon_loader->GetFavicon().empty()); | 190 EXPECT_TRUE(favicon_loader->GetFavicon().empty()); |
| 191 ASSERT_NO_FATAL_FAILURE(ResetDownloads()); | 191 ASSERT_NO_FATAL_FAILURE(ResetDownloads()); |
| 192 | 192 |
| 193 NavigateTo("launcher-largefavicon.html"); | 193 NavigateTo("launcher-largefavicon.html"); |
| 194 EXPECT_TRUE(WaitForFaviconDownloads()); | 194 EXPECT_TRUE(WaitForFaviconDownloads()); |
| 195 EXPECT_FALSE(favicon_loader->GetFavicon().empty()); | 195 EXPECT_FALSE(favicon_loader->GetFavicon().empty()); |
| 196 EXPECT_EQ(128, favicon_loader->GetFavicon().height()); | 196 EXPECT_EQ(128, favicon_loader->GetFavicon().height()); |
| 197 } | 197 } |
| OLD | NEW |