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

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

Issue 12995025: [Mac] DownloadShelf should be notified when autoclosing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: + NSTrackingInVisibleRect Created 7 years, 8 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) 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 <sstream> 5 #include <sstream>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible()); 1244 EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible());
1245 1245
1246 // Open a second tab and wait. 1246 // Open a second tab and wait.
1247 EXPECT_NE(static_cast<WebContents*>(NULL), 1247 EXPECT_NE(static_cast<WebContents*>(NULL),
1248 chrome::AddSelectedTabWithURL(browser(), GURL(), 1248 chrome::AddSelectedTabWithURL(browser(), GURL(),
1249 content::PAGE_TRANSITION_TYPED)); 1249 content::PAGE_TRANSITION_TYPED));
1250 EXPECT_EQ(2, browser()->tab_strip_model()->count()); 1250 EXPECT_EQ(2, browser()->tab_strip_model()->count());
1251 EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible()); 1251 EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible());
1252 1252
1253 // Hide the download shelf. 1253 // Hide the download shelf.
1254 browser()->window()->GetDownloadShelf()->Close(); 1254 browser()->window()->GetDownloadShelf()->Close(DownloadShelf::AUTOMATIC);
1255 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); 1255 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible());
1256 1256
1257 // Go to the first tab. 1257 // Go to the first tab.
1258 browser()->tab_strip_model()->ActivateTabAt(0, true); 1258 browser()->tab_strip_model()->ActivateTabAt(0, true);
1259 EXPECT_EQ(2, browser()->tab_strip_model()->count()); 1259 EXPECT_EQ(2, browser()->tab_strip_model()->count());
1260 1260
1261 // The download shelf should not be visible. 1261 // The download shelf should not be visible.
1262 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); 1262 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible());
1263 } 1263 }
1264 1264
(...skipping 1657 matching lines...) Expand 10 before | Expand all | Expand 10 after
2922 scoped_ptr<content::DownloadTestObserver> observer( 2922 scoped_ptr<content::DownloadTestObserver> observer(
2923 DangerousDownloadWaiter( 2923 DangerousDownloadWaiter(
2924 browser(), 1, 2924 browser(), 1,
2925 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY)); 2925 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY));
2926 ui_test_utils::NavigateToURL(browser(), url); 2926 ui_test_utils::NavigateToURL(browser(), url);
2927 observer->WaitForFinished(); 2927 observer->WaitForFinished();
2928 EXPECT_EQ(1u, observer->NumDownloadsSeenInState(DownloadItem::CANCELLED)); 2928 EXPECT_EQ(1u, observer->NumDownloadsSeenInState(DownloadItem::CANCELLED));
2929 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen()); 2929 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen());
2930 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); 2930 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible());
2931 } 2931 }
OLDNEW
« no previous file with comments | « chrome/browser/automation/testing_automation_provider.cc ('k') | chrome/browser/download/download_shelf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698