Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: chrome/browser/download/save_page_browsertest.cc

Issue 9224002: Make WebUI objects not derive from WebUI. WebUI objects own the controller. This is the ownership... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync to head to clear linux_chromeos browsertest failures Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/scoped_temp_dir.h" 10 #include "base/scoped_temp_dir.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 content::NotificationService::AllSources()); 90 content::NotificationService::AllSources());
91 return content::Details<DownloadItem>(observer.details()).ptr()-> 91 return content::Details<DownloadItem>(observer.details()).ptr()->
92 GetOriginalUrl(); 92 GetOriginalUrl();
93 } 93 }
94 94
95 #if defined(OS_CHROMEOS) && !defined(USE_AURA) 95 #if defined(OS_CHROMEOS) && !defined(USE_AURA)
96 const ActiveDownloadsUI::DownloadList& GetDownloads() const { 96 const ActiveDownloadsUI::DownloadList& GetDownloads() const {
97 Browser* popup = ActiveDownloadsUI::GetPopup(); 97 Browser* popup = ActiveDownloadsUI::GetPopup();
98 EXPECT_TRUE(popup); 98 EXPECT_TRUE(popup);
99 ActiveDownloadsUI* downloads_ui = static_cast<ActiveDownloadsUI*>( 99 ActiveDownloadsUI* downloads_ui = static_cast<ActiveDownloadsUI*>(
100 popup->GetSelectedWebContents()->GetWebUI()); 100 popup->GetSelectedWebContents()->GetWebUI()->GetController());
101 EXPECT_TRUE(downloads_ui); 101 EXPECT_TRUE(downloads_ui);
102 return downloads_ui->GetDownloads(); 102 return downloads_ui->GetDownloads();
103 } 103 }
104 #endif 104 #endif
105 105
106 void CheckDownloadUI(const FilePath& download_path) const { 106 void CheckDownloadUI(const FilePath& download_path) const {
107 #if defined(OS_CHROMEOS) && !defined(USE_AURA) 107 #if defined(OS_CHROMEOS) && !defined(USE_AURA)
108 const ActiveDownloadsUI::DownloadList& downloads = GetDownloads(); 108 const ActiveDownloadsUI::DownloadList& downloads = GetDownloads();
109 EXPECT_EQ(downloads.size(), 1U); 109 EXPECT_EQ(downloads.size(), 1U);
110 110
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, ExplicitCancel) { 347 IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, ExplicitCancel) {
348 GURL url = NavigateToMockURL("a"); 348 GURL url = NavigateToMockURL("a");
349 FilePath full_file_name, dir; 349 FilePath full_file_name, dir;
350 GetDestinationPaths("a", &full_file_name, &dir); 350 GetDestinationPaths("a", &full_file_name, &dir);
351 scoped_refptr<SavePackage> save_package(new SavePackage(GetCurrentTab(), 351 scoped_refptr<SavePackage> save_package(new SavePackage(GetCurrentTab(),
352 SavePackage::SAVE_AS_ONLY_HTML, full_file_name, dir)); 352 SavePackage::SAVE_AS_ONLY_HTML, full_file_name, dir));
353 save_package->Cancel(true); 353 save_package->Cancel(true);
354 } 354 }
355 355
356 } // namespace 356 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698