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

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

Issue 102593002: Convert string16 to base::string16 in content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
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 <string> 5 #include <string>
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 339
340 // Test that the suggested names generated by SavePackage are reasonable: 340 // Test that the suggested names generated by SavePackage are reasonable:
341 // If the name is a URL, retrieve only the path component since the path name 341 // If the name is a URL, retrieve only the path component since the path name
342 // generation code will turn the entire URL into the file name leading to bad 342 // generation code will turn the entire URL into the file name leading to bad
343 // extension names. For example, a page with no title and a URL: 343 // extension names. For example, a page with no title and a URL:
344 // http://www.foo.com/a/path/name.txt will turn into file: 344 // http://www.foo.com/a/path/name.txt will turn into file:
345 // "http www.foo.com a path name.txt", when we want to save it as "name.txt". 345 // "http www.foo.com a path name.txt", when we want to save it as "name.txt".
346 346
347 static const struct SuggestedSaveNameTestCase { 347 static const struct SuggestedSaveNameTestCase {
348 const char* page_url; 348 const char* page_url;
349 const string16 page_title; 349 const base::string16 page_title;
350 const base::FilePath::CharType* expected_name; 350 const base::FilePath::CharType* expected_name;
351 bool ensure_html_extension; 351 bool ensure_html_extension;
352 } kSuggestedSaveNames[] = { 352 } kSuggestedSaveNames[] = {
353 // Title overrides the URL. 353 // Title overrides the URL.
354 { "http://foo.com", 354 { "http://foo.com",
355 ASCIIToUTF16("A page title"), 355 ASCIIToUTF16("A page title"),
356 FPL("A page title") FPL_HTML_EXTENSION, 356 FPL("A page title") FPL_HTML_EXTENSION,
357 true 357 true
358 }, 358 },
359 // Extension is preserved. 359 // Extension is preserved.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 GURL view_source_url = URLRequestMockHTTPJob::GetMockViewSourceUrl( 431 GURL view_source_url = URLRequestMockHTTPJob::GetMockViewSourceUrl(
432 base::FilePath(kTestDir).Append(file_name)); 432 base::FilePath(kTestDir).Append(file_name));
433 GURL actual_url = URLRequestMockHTTPJob::GetMockUrl( 433 GURL actual_url = URLRequestMockHTTPJob::GetMockUrl(
434 base::FilePath(kTestDir).Append(file_name)); 434 base::FilePath(kTestDir).Append(file_name));
435 NavigateAndCommit(view_source_url); 435 NavigateAndCommit(view_source_url);
436 EXPECT_EQ(actual_url, GetUrlToBeSaved()); 436 EXPECT_EQ(actual_url, GetUrlToBeSaved());
437 EXPECT_EQ(view_source_url, contents()->GetLastCommittedURL()); 437 EXPECT_EQ(view_source_url, contents()->GetLastCommittedURL());
438 } 438 }
439 439
440 } // namespace content 440 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/save_package.h ('k') | content/browser/frame_host/interstitial_page_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698