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

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

Issue 7618048: Move the core download files to content. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 "base/file_util.h" 5 #include "base/file_util.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "base/scoped_temp_dir.h" 7 #include "base/scoped_temp_dir.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "chrome/browser/download/download_create_info.h"
10 #include "chrome/browser/download/download_file.h"
11 #include "chrome/browser/download/download_manager.h"
12 #include "chrome/browser/download/download_request_handle.h"
13 #include "chrome/browser/download/download_status_updater.h"
14 #include "chrome/browser/download/download_util.h" 9 #include "chrome/browser/download/download_util.h"
15 #include "chrome/browser/download/mock_download_manager.h"
16 #include "chrome/browser/download/mock_download_manager_delegate.h" 10 #include "chrome/browser/download/mock_download_manager_delegate.h"
17 #include "content/browser/browser_thread.h" 11 #include "content/browser/browser_thread.h"
12 #include "content/browser/download/download_create_info.h"
13 #include "content/browser/download/download_file.h"
14 #include "content/browser/download/download_manager.h"
15 #include "content/browser/download/download_request_handle.h"
16 #include "content/browser/download/download_status_updater.h"
17 #include "content/browser/download/mock_download_manager.h"
18 #include "net/base/file_stream.h" 18 #include "net/base/file_stream.h"
19 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
20 20
21 class DownloadFileTest : public testing::Test { 21 class DownloadFileTest : public testing::Test {
22 public: 22 public:
23 23
24 static const char* kTestData1; 24 static const char* kTestData1;
25 static const char* kTestData2; 25 static const char* kTestData2;
26 static const char* kTestData3; 26 static const char* kTestData3;
27 static const char* kDataHash; 27 static const char* kDataHash;
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 // Check the files. 187 // Check the files.
188 EXPECT_FALSE(file_util::PathExists(path_3)); 188 EXPECT_FALSE(file_util::PathExists(path_3));
189 EXPECT_TRUE(file_util::PathExists(path_4)); 189 EXPECT_TRUE(file_util::PathExists(path_4));
190 190
191 // Check the hash. 191 // Check the hash.
192 EXPECT_TRUE(download_file_->GetSha256Hash(&hash)); 192 EXPECT_TRUE(download_file_->GetSha256Hash(&hash));
193 EXPECT_EQ(kDataHash, base::HexEncode(hash.data(), hash.size())); 193 EXPECT_EQ(kDataHash, base::HexEncode(hash.data(), hash.size()));
194 194
195 DestroyDownloadFile(&download_file_, 0); 195 DestroyDownloadFile(&download_file_, 0);
196 } 196 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698