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

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

Issue 541743002: Move url_request_mock_http_job to net/test/url_request/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a few compile errors Created 6 years, 3 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/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 20 matching lines...) Expand all
31 #include "chrome/common/pref_names.h" 31 #include "chrome/common/pref_names.h"
32 #include "chrome/common/url_constants.h" 32 #include "chrome/common/url_constants.h"
33 #include "chrome/test/base/in_process_browser_test.h" 33 #include "chrome/test/base/in_process_browser_test.h"
34 #include "chrome/test/base/ui_test_utils.h" 34 #include "chrome/test/base/ui_test_utils.h"
35 #include "content/public/browser/download_item.h" 35 #include "content/public/browser/download_item.h"
36 #include "content/public/browser/download_manager.h" 36 #include "content/public/browser/download_manager.h"
37 #include "content/public/browser/notification_service.h" 37 #include "content/public/browser/notification_service.h"
38 #include "content/public/browser/notification_types.h" 38 #include "content/public/browser/notification_types.h"
39 #include "content/public/browser/web_contents.h" 39 #include "content/public/browser/web_contents.h"
40 #include "content/public/test/test_utils.h" 40 #include "content/public/test/test_utils.h"
41 #include "content/test/net/url_request_mock_http_job.h" 41 #include "net/test/url_request/url_request_mock_http_job.h"
42 #include "testing/gtest/include/gtest/gtest.h" 42 #include "testing/gtest/include/gtest/gtest.h"
43 43
44 using content::BrowserContext; 44 using content::BrowserContext;
45 using content::BrowserThread; 45 using content::BrowserThread;
46 using content::DownloadItem; 46 using content::DownloadItem;
47 using content::DownloadManager; 47 using content::DownloadManager;
48 using content::URLRequestMockHTTPJob;
49 using content::WebContents; 48 using content::WebContents;
49 using net::URLRequestMockHTTPJob;
50 50
51 namespace { 51 namespace {
52 52
53 // Waits for an item record in the downloads database to match |filter|. See 53 // Waits for an item record in the downloads database to match |filter|. See
54 // DownloadStoredProperly() below for an example filter. 54 // DownloadStoredProperly() below for an example filter.
55 class DownloadPersistedObserver : public DownloadHistory::Observer { 55 class DownloadPersistedObserver : public DownloadHistory::Observer {
56 public: 56 public:
57 typedef base::Callback<bool( 57 typedef base::Callback<bool(
58 DownloadItem* item, 58 DownloadItem* item,
59 const history::DownloadRow&)> PersistedFilter; 59 const history::DownloadRow&)> PersistedFilter;
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 base::FilePath download_dir = DownloadPrefs::FromDownloadManager( 800 base::FilePath download_dir = DownloadPrefs::FromDownloadManager(
801 GetDownloadManager())->DownloadPath(); 801 GetDownloadManager())->DownloadPath();
802 base::FilePath filename = download_dir.AppendASCII("dataurl.txt"); 802 base::FilePath filename = download_dir.AppendASCII("dataurl.txt");
803 ASSERT_TRUE(base::PathExists(filename)); 803 ASSERT_TRUE(base::PathExists(filename));
804 std::string contents; 804 std::string contents;
805 EXPECT_TRUE(base::ReadFileToString(filename, &contents)); 805 EXPECT_TRUE(base::ReadFileToString(filename, &contents));
806 EXPECT_EQ("foo", contents); 806 EXPECT_EQ("foo", contents);
807 } 807 }
808 808
809 } // namespace 809 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698