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

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

Issue 100573002: Move directory creation functions to base namespace. (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 <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/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 2876 matching lines...) Expand 10 before | Expand all | Expand 10 after
2887 L"jiho!@#$tiho$%^&-()_+=miho copy.zip", // special chars 2887 L"jiho!@#$tiho$%^&-()_+=miho copy.zip", // special chars
2888 L"Wohoo-to hoo+I.zip", 2888 L"Wohoo-to hoo+I.zip",
2889 L"Picture 1.zip", 2889 L"Picture 1.zip",
2890 L"This is a very very long english sentence with spaces and , and +.zip", 2890 L"This is a very very long english sentence with spaces and , and +.zip",
2891 }; 2891 };
2892 2892
2893 std::vector<DownloadItem*> download_items; 2893 std::vector<DownloadItem*> download_items;
2894 static const int kFlags = (base::PLATFORM_FILE_CREATE | 2894 static const int kFlags = (base::PLATFORM_FILE_CREATE |
2895 base::PLATFORM_FILE_WRITE); 2895 base::PLATFORM_FILE_WRITE);
2896 base::FilePath origin(FILE_PATH_LITERAL("origin")); 2896 base::FilePath origin(FILE_PATH_LITERAL("origin"));
2897 ASSERT_TRUE(file_util::CreateDirectory(DestinationFile(browser(), origin))); 2897 ASSERT_TRUE(base::CreateDirectory(DestinationFile(browser(), origin)));
2898 2898
2899 for (size_t index = 0; index < arraysize(kCrazyFilenames); ++index) { 2899 for (size_t index = 0; index < arraysize(kCrazyFilenames); ++index) {
2900 string16 crazy16; 2900 string16 crazy16;
2901 std::string crazy8; 2901 std::string crazy8;
2902 const wchar_t* crazy_w = kCrazyFilenames[index]; 2902 const wchar_t* crazy_w = kCrazyFilenames[index];
2903 ASSERT_TRUE(WideToUTF8(crazy_w, wcslen(crazy_w), &crazy8)); 2903 ASSERT_TRUE(WideToUTF8(crazy_w, wcslen(crazy_w), &crazy8));
2904 ASSERT_TRUE(WideToUTF16(crazy_w, wcslen(crazy_w), &crazy16)); 2904 ASSERT_TRUE(WideToUTF16(crazy_w, wcslen(crazy_w), &crazy16));
2905 base::FilePath file_path(DestinationFile(browser(), origin.Append( 2905 base::FilePath file_path(DestinationFile(browser(), origin.Append(
2906 #if defined(OS_WIN) 2906 #if defined(OS_WIN)
2907 crazy16 2907 crazy16
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
3250 3250
3251 // No errors this time. The download should complete successfully. 3251 // No errors this time. The download should complete successfully.
3252 EXPECT_FALSE(completion_observer->IsFinished()); 3252 EXPECT_FALSE(completion_observer->IsFinished());
3253 completion_observer->StartObserving(); 3253 completion_observer->StartObserving();
3254 download->Resume(); 3254 download->Resume();
3255 completion_observer->WaitForFinished(); 3255 completion_observer->WaitForFinished();
3256 EXPECT_EQ(DownloadItem::COMPLETE, download->GetState()); 3256 EXPECT_EQ(DownloadItem::COMPLETE, download->GetState());
3257 3257
3258 EXPECT_FALSE(DidShowFileChooser()); 3258 EXPECT_FALSE(DidShowFileChooser());
3259 } 3259 }
OLDNEW
« no previous file with comments | « chrome/browser/component_updater/test/test_installer.cc ('k') | chrome/browser/download/download_path_reservation_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698