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

Side by Side Diff: content/browser/download/save_package_unittest.cc

Issue 7373004: Move the save file code from chrome to content. This is just a file move so the DEPS in content\b... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <string> 5 #include <string>
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/scoped_temp_dir.h" 9 #include "base/scoped_temp_dir.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "chrome/browser/download/save_package.h"
13 #include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h" 12 #include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h"
14 #include "content/browser/browser_thread.h" 13 #include "content/browser/browser_thread.h"
14 #include "content/browser/download/save_package.h"
15 #include "content/browser/net/url_request_mock_http_job.h" 15 #include "content/browser/net/url_request_mock_http_job.h"
16 #include "content/browser/tab_contents/test_tab_contents.h" 16 #include "content/browser/tab_contents/test_tab_contents.h"
17 #include "googleurl/src/gurl.h" 17 #include "googleurl/src/gurl.h"
18 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
19 19
20 #define FPL FILE_PATH_LITERAL 20 #define FPL FILE_PATH_LITERAL
21 #if defined(OS_WIN) 21 #if defined(OS_WIN)
22 #define HTML_EXTENSION ".htm" 22 #define HTML_EXTENSION ".htm"
23 // This second define is needed because MSVC is broken. 23 // This second define is needed because MSVC is broken.
24 #define FPL_HTML_EXTENSION L".htm" 24 #define FPL_HTML_EXTENSION L".htm"
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 TEST_F(SavePackageTest, TestGetUrlToBeSavedViewSource) { 417 TEST_F(SavePackageTest, TestGetUrlToBeSavedViewSource) {
418 FilePath file_name(FILE_PATH_LITERAL("a.htm")); 418 FilePath file_name(FILE_PATH_LITERAL("a.htm"));
419 GURL view_source_url = URLRequestMockHTTPJob::GetMockViewSourceUrl( 419 GURL view_source_url = URLRequestMockHTTPJob::GetMockViewSourceUrl(
420 FilePath(kTestDir).Append(file_name)); 420 FilePath(kTestDir).Append(file_name));
421 GURL actual_url = URLRequestMockHTTPJob::GetMockUrl( 421 GURL actual_url = URLRequestMockHTTPJob::GetMockUrl(
422 FilePath(kTestDir).Append(file_name)); 422 FilePath(kTestDir).Append(file_name));
423 NavigateAndCommit(view_source_url); 423 NavigateAndCommit(view_source_url);
424 EXPECT_EQ(actual_url, GetUrlToBeSaved()); 424 EXPECT_EQ(actual_url, GetUrlToBeSaved());
425 EXPECT_EQ(view_source_url, contents()->GetURL()); 425 EXPECT_EQ(view_source_url, contents()->GetURL());
426 } 426 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698