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

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

Issue 233723002: Workarounding fix for save complete page problems. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 callback_(callback) { 252 callback_(callback) {
253 download_manager_->AddObserver(this); 253 download_manager_->AddObserver(this);
254 } 254 }
255 255
256 virtual ~SavePackageFinishedObserver() { 256 virtual ~SavePackageFinishedObserver() {
257 if (download_manager_) 257 if (download_manager_)
258 download_manager_->RemoveObserver(this); 258 download_manager_->RemoveObserver(this);
259 } 259 }
260 260
261 // DownloadManager::Observer: 261 // DownloadManager::Observer:
262 virtual void OnSavePackageSuccessfullyFinished( 262 virtual void OnSavePackageFinished(
263 content::DownloadManager* manager, content::DownloadItem* item) OVERRIDE { 263 bool success,
264 content::DownloadManager* manager,
265 content::DownloadItem* item) OVERRIDE {
264 callback_.Run(); 266 callback_.Run();
265 } 267 }
266 virtual void ManagerGoingDown(content::DownloadManager* manager) OVERRIDE { 268 virtual void ManagerGoingDown(content::DownloadManager* manager) OVERRIDE {
267 download_manager_->RemoveObserver(this); 269 download_manager_->RemoveObserver(this);
268 download_manager_ = NULL; 270 download_manager_ = NULL;
269 } 271 }
270 272
271 private: 273 private:
272 content::DownloadManager* download_manager_; 274 content::DownloadManager* download_manager_;
273 base::Closure callback_; 275 base::Closure callback_;
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 GetDownloadManager())->DownloadPath(); 802 GetDownloadManager())->DownloadPath();
801 base::FilePath filename = download_dir.AppendASCII("dataurl.txt"); 803 base::FilePath filename = download_dir.AppendASCII("dataurl.txt");
802 ASSERT_TRUE(base::PathExists(filename)); 804 ASSERT_TRUE(base::PathExists(filename));
803 std::string contents; 805 std::string contents;
804 EXPECT_TRUE(base::ReadFileToString(filename, &contents)); 806 EXPECT_TRUE(base::ReadFileToString(filename, &contents));
805 EXPECT_EQ("foo", contents); 807 EXPECT_EQ("foo", contents);
806 } 808 }
807 809
808 } // namespace 810 } // namespace
809 811
OLDNEW
« no previous file with comments | « chrome/browser/browser_encoding_browsertest.cc ('k') | content/browser/download/download_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698