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

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

Issue 5516006: Fix the Visual Studio 2005 build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/file_path.h" 5 #include "base/file_path.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/scoped_temp_dir.h" 8 #include "base/scoped_temp_dir.h"
9 #include "base/test/test_file_util.h" 9 #include "base/test/test_file_util.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // finished_downloads_ (done by OnDownloadUpdated). 115 // finished_downloads_ (done by OnDownloadUpdated).
116 std::vector<DownloadItem*> downloads; 116 std::vector<DownloadItem*> downloads;
117 download_manager_->SearchDownloads(string16(), &downloads); 117 download_manager_->SearchDownloads(string16(), &downloads);
118 118
119 std::vector<DownloadItem*>::iterator it = downloads.begin(); 119 std::vector<DownloadItem*>::iterator it = downloads.begin();
120 for (; it != downloads.end(); ++it) { 120 for (; it != downloads.end(); ++it) {
121 OnDownloadUpdated(*it); // Safe to call multiple times; checks state. 121 OnDownloadUpdated(*it); // Safe to call multiple times; checks state.
122 122
123 std::set<DownloadItem*>::const_iterator 123 std::set<DownloadItem*>::const_iterator
124 finished_it(finished_downloads_.find(*it)); 124 finished_it(finished_downloads_.find(*it));
125 std::set<DownloadItem*>::const_iterator 125 std::set<DownloadItem*>::iterator
126 observed_it(downloads_observed_.find(*it)); 126 observed_it(downloads_observed_.find(*it));
127 127
128 // If it isn't finished and we're aren't observing it, start. 128 // If it isn't finished and we're aren't observing it, start.
129 if (finished_it == finished_downloads_.end() && 129 if (finished_it == finished_downloads_.end() &&
130 observed_it == downloads_observed_.end()) { 130 observed_it == downloads_observed_.end()) {
131 (*it)->AddObserver(this); 131 (*it)->AddObserver(this);
132 downloads_observed_.insert(*it); 132 downloads_observed_.insert(*it);
133 continue; 133 continue;
134 } 134 }
135 135
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 browser(), URLRequestMockHTTPJob::GetMockUrl(file)); 329 browser(), URLRequestMockHTTPJob::GetMockUrl(file));
330 observer->WaitForFinished(); 330 observer->WaitForFinished();
331 331
332 // Download should not be finished; check state. 332 // Download should not be finished; check state.
333 EXPECT_TRUE(observer->select_file_dialog_seen()); 333 EXPECT_TRUE(observer->select_file_dialog_seen());
334 EXPECT_EQ(1, browser()->tab_count()); 334 EXPECT_EQ(1, browser()->tab_count());
335 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); 335 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible());
336 } 336 }
337 337
338 } // namespace 338 } // namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698