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

Side by Side Diff: chrome_frame/test/urlmon_moniker_unittest.cc

Issue 19579005: Move ReadFileToString to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 <atlbase.h> 5 #include <atlbase.h>
6 #include <atlcom.h> 6 #include <atlcom.h>
7 7
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/win/scoped_comptr.h" 10 #include "base/win/scoped_comptr.h"
(...skipping 14 matching lines...) Expand all
25 DeleteAllSingletons(); 25 DeleteAllSingletons();
26 PathService::Get(base::DIR_SOURCE_ROOT, &test_file_path_); 26 PathService::Get(base::DIR_SOURCE_ROOT, &test_file_path_);
27 test_file_path_ = test_file_path_.Append(FILE_PATH_LITERAL("chrome_frame")) 27 test_file_path_ = test_file_path_.Append(FILE_PATH_LITERAL("chrome_frame"))
28 .Append(FILE_PATH_LITERAL("test")) 28 .Append(FILE_PATH_LITERAL("test"))
29 .Append(FILE_PATH_LITERAL("data")); 29 .Append(FILE_PATH_LITERAL("data"));
30 } 30 }
31 31
32 bool ReadFileAsString(const wchar_t* file_name, std::string* file_contents) { 32 bool ReadFileAsString(const wchar_t* file_name, std::string* file_contents) {
33 EXPECT_TRUE(file_name); 33 EXPECT_TRUE(file_name);
34 base::FilePath file_path = test_file_path_.Append(file_name); 34 base::FilePath file_path = test_file_path_.Append(file_name);
35 return file_util::ReadFileToString(file_path, file_contents); 35 return base::ReadFileToString(file_path, file_contents);
36 } 36 }
37 37
38 static bool StringToStream(const std::string& data, IStream** ret) { 38 static bool StringToStream(const std::string& data, IStream** ret) {
39 EXPECT_TRUE(!data.empty()); 39 EXPECT_TRUE(!data.empty());
40 40
41 base::win::ScopedComPtr<IStream> stream; 41 base::win::ScopedComPtr<IStream> stream;
42 HRESULT hr = CreateStreamOnHGlobal(NULL, TRUE, stream.Receive()); 42 HRESULT hr = CreateStreamOnHGlobal(NULL, TRUE, stream.Receive());
43 EXPECT_HRESULT_SUCCEEDED(hr); 43 EXPECT_HRESULT_SUCCEEDED(hr);
44 if (FAILED(hr)) { 44 if (FAILED(hr)) {
45 return false; 45 return false;
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 244
245 std::string data_read; 245 std::string data_read;
246 data_read.append(read_buffer1.get(), read_size1); 246 data_read.append(read_buffer1.get(), read_size1);
247 data_read.append(read_buffer2.get(), read_size2); 247 data_read.append(read_buffer2.get(), read_size2);
248 EXPECT_EQ(small_html_meta_tag, data_read); 248 EXPECT_EQ(small_html_meta_tag, data_read);
249 249
250 EXPECT_EQ(S_FALSE, ret3); 250 EXPECT_EQ(S_FALSE, ret3);
251 EXPECT_STREQ("", read_buffer3); 251 EXPECT_STREQ("", read_buffer3);
252 EXPECT_EQ(sizeof(read_buffer3), read_size3); 252 EXPECT_EQ(sizeof(read_buffer3), read_size3);
253 } 253 }
OLDNEW
« no previous file with comments | « chrome_frame/test/test_with_web_server.cc ('k') | chromeos/network/client_cert_resolver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698