| 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/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/views/ash/launcher/launcher_favicon_loader.h" | 10 #include "chrome/browser/ui/views/ash/launcher/launcher_favicon_loader.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 } // namespace | 70 } // namespace |
| 71 | 71 |
| 72 class LauncherFaviconLoaderBrowsertest : public InProcessBrowserTest { | 72 class LauncherFaviconLoaderBrowsertest : public InProcessBrowserTest { |
| 73 protected: | 73 protected: |
| 74 void NavigateTo(Browser* browser, const char* url) { | 74 void NavigateTo(Browser* browser, const char* url) { |
| 75 std::string url_path = base::StringPrintf("files/ash/launcher/%s", url); | 75 std::string url_path = base::StringPrintf("files/ash/launcher/%s", url); |
| 76 ui_test_utils::NavigateToURL(browser, test_server()->GetURL(url_path)); | 76 ui_test_utils::NavigateToURL(browser, test_server()->GetURL(url_path)); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void CreatePanelBrowser(const char* url, Browser** result) { | 79 void CreatePanelBrowser(const char* url, Browser** result) { |
| 80 Browser* panel_browser = Browser::CreateForApp(Browser::TYPE_PANEL, | 80 Browser* panel_browser = Browser::CreateWithParams( |
| 81 "Test Panel", | 81 Browser::CreateParams::CreateForApp( |
| 82 gfx::Rect(), | 82 Browser::TYPE_PANEL, "Test Panel", gfx::Rect(), |
| 83 browser()->profile()); | 83 browser()->profile())); |
| 84 EXPECT_TRUE(panel_browser->is_type_panel()); | 84 EXPECT_TRUE(panel_browser->is_type_panel()); |
| 85 ASSERT_EQ(static_cast<void*>(NULL), contents_observer_.get()); | 85 ASSERT_EQ(static_cast<void*>(NULL), contents_observer_.get()); |
| 86 // Load initial tab contents before setting the observer. | 86 // Load initial tab contents before setting the observer. |
| 87 ui_test_utils::NavigateToURL(panel_browser, GURL()); | 87 ui_test_utils::NavigateToURL(panel_browser, GURL()); |
| 88 contents_observer_.reset( | 88 contents_observer_.reset( |
| 89 new ContentsObserver(panel_browser->GetWebContentsAt(0))); | 89 new ContentsObserver(panel_browser->GetWebContentsAt(0))); |
| 90 NavigateTo(panel_browser, url); | 90 NavigateTo(panel_browser, url); |
| 91 *result = panel_browser; | 91 *result = panel_browser; |
| 92 } | 92 } |
| 93 | 93 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 NavigateTo(panel_browser, "launcher-smallfavicon.html"); | 184 NavigateTo(panel_browser, "launcher-smallfavicon.html"); |
| 185 EXPECT_TRUE(WaitForFaviconDownlads(1)); | 185 EXPECT_TRUE(WaitForFaviconDownlads(1)); |
| 186 EXPECT_TRUE(favicon_loader->GetFavicon().empty()); | 186 EXPECT_TRUE(favicon_loader->GetFavicon().empty()); |
| 187 ASSERT_NO_FATAL_FAILURE(ResetDownloads()); | 187 ASSERT_NO_FATAL_FAILURE(ResetDownloads()); |
| 188 | 188 |
| 189 NavigateTo(panel_browser, "launcher-largefavicon.html"); | 189 NavigateTo(panel_browser, "launcher-largefavicon.html"); |
| 190 EXPECT_TRUE(WaitForFaviconDownlads(1)); | 190 EXPECT_TRUE(WaitForFaviconDownlads(1)); |
| 191 EXPECT_FALSE(favicon_loader->GetFavicon().empty()); | 191 EXPECT_FALSE(favicon_loader->GetFavicon().empty()); |
| 192 EXPECT_EQ(128, favicon_loader->GetFavicon().height()); | 192 EXPECT_EQ(128, favicon_loader->GetFavicon().height()); |
| 193 } | 193 } |
| OLD | NEW |