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

Side by Side Diff: extensions/browser/file_reader_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
« no previous file with comments | « extensions/browser/file_reader.cc ('k') | gpu/config/gpu_info_collector_x11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 void RunBasicTest(const char* filename) { 55 void RunBasicTest(const char* filename) {
56 base::FilePath path; 56 base::FilePath path;
57 PathService::Get(DIR_TEST_DATA, &path); 57 PathService::Get(DIR_TEST_DATA, &path);
58 std::string extension_id = id_util::GenerateId("test"); 58 std::string extension_id = id_util::GenerateId("test");
59 ExtensionResource resource( 59 ExtensionResource resource(
60 extension_id, path, base::FilePath().AppendASCII(filename)); 60 extension_id, path, base::FilePath().AppendASCII(filename));
61 path = path.AppendASCII(filename); 61 path = path.AppendASCII(filename);
62 62
63 std::string file_contents; 63 std::string file_contents;
64 ASSERT_TRUE(file_util::ReadFileToString(path, &file_contents)); 64 ASSERT_TRUE(base::ReadFileToString(path, &file_contents));
65 65
66 Receiver receiver; 66 Receiver receiver;
67 67
68 scoped_refptr<FileReader> file_reader( 68 scoped_refptr<FileReader> file_reader(
69 new FileReader(resource, receiver.NewCallback())); 69 new FileReader(resource, receiver.NewCallback()));
70 file_reader->Start(); 70 file_reader->Start();
71 71
72 base::MessageLoop::current()->Run(); 72 base::MessageLoop::current()->Run();
73 73
74 EXPECT_TRUE(receiver.succeeded()); 74 EXPECT_TRUE(receiver.succeeded());
(...skipping 21 matching lines...) Expand all
96 scoped_refptr<FileReader> file_reader( 96 scoped_refptr<FileReader> file_reader(
97 new FileReader(resource, receiver.NewCallback())); 97 new FileReader(resource, receiver.NewCallback()));
98 file_reader->Start(); 98 file_reader->Start();
99 99
100 base::MessageLoop::current()->Run(); 100 base::MessageLoop::current()->Run();
101 101
102 EXPECT_FALSE(receiver.succeeded()); 102 EXPECT_FALSE(receiver.succeeded());
103 } 103 }
104 104
105 } // namespace extensions 105 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/file_reader.cc ('k') | gpu/config/gpu_info_collector_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698