| OLD | NEW |
| 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_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 13 #include "base/scoped_temp_dir.h" | 13 #include "base/scoped_temp_dir.h" |
| 14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
| 15 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
| 16 #include "base/test/test_file_util.h" | 16 #include "base/test/test_file_util.h" |
| 17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
| 18 #include "chrome/app/chrome_command_ids.h" | 18 #include "chrome/app/chrome_command_ids.h" |
| 19 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
| 20 #include "chrome/browser/cancelable_request.h" | 20 #include "chrome/browser/common/cancelable_request.h" |
| 21 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 21 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
| 22 #include "chrome/browser/download/download_crx_util.h" | 22 #include "chrome/browser/download/download_crx_util.h" |
| 23 #include "chrome/browser/download/download_history.h" | 23 #include "chrome/browser/download/download_history.h" |
| 24 #include "chrome/browser/download/download_prefs.h" | 24 #include "chrome/browser/download/download_prefs.h" |
| 25 #include "chrome/browser/download/download_request_limiter.h" | 25 #include "chrome/browser/download/download_request_limiter.h" |
| 26 #include "chrome/browser/download/download_shelf.h" | 26 #include "chrome/browser/download/download_shelf.h" |
| 27 #include "chrome/browser/download/download_test_file_chooser_observer.h" | 27 #include "chrome/browser/download/download_test_file_chooser_observer.h" |
| 28 #include "chrome/browser/download/download_util.h" | 28 #include "chrome/browser/download/download_util.h" |
| 29 #include "chrome/browser/extensions/extension_install_prompt.h" | 29 #include "chrome/browser/extensions/extension_install_prompt.h" |
| 30 #include "chrome/browser/extensions/extension_service.h" | 30 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 2204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2235 GetDownloads(browser(), &download_items); | 2235 GetDownloads(browser(), &download_items); |
| 2236 ASSERT_EQ(1u, download_items.size()); | 2236 ASSERT_EQ(1u, download_items.size()); |
| 2237 ASSERT_EQ(test_server()->GetURL("echoheader?Referer"), | 2237 ASSERT_EQ(test_server()->GetURL("echoheader?Referer"), |
| 2238 download_items[0]->GetOriginalUrl()); | 2238 download_items[0]->GetOriginalUrl()); |
| 2239 | 2239 |
| 2240 // Check that the file contains the expected referrer. | 2240 // Check that the file contains the expected referrer. |
| 2241 FilePath file(download_items[0]->GetFullPath()); | 2241 FilePath file(download_items[0]->GetFullPath()); |
| 2242 std::string expected_contents = test_server()->GetURL("").spec(); | 2242 std::string expected_contents = test_server()->GetURL("").spec(); |
| 2243 ASSERT_TRUE(VerifyFile(file, expected_contents, expected_contents.length())); | 2243 ASSERT_TRUE(VerifyFile(file, expected_contents, expected_contents.length())); |
| 2244 } | 2244 } |
| OLD | NEW |