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

Side by Side Diff: chrome/browser/media_galleries/fileapi/itunes_data_provider_browsertest.cc

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 " <key>Location</key><string>%s</string>\n" 186 " <key>Location</key><string>%s</string>\n"
187 " <key>Artist</key><string>%s</string>\n" 187 " <key>Artist</key><string>%s</string>\n"
188 " <key>Album</key><string>%s</string>\n" 188 " <key>Album</key><string>%s</string>\n"
189 "</dict>\n", 189 "</dict>\n",
190 i + 1, i + 1, location.spec().c_str(), entries[i].artist.c_str(), 190 i + 1, i + 1, location.spec().c_str(), entries[i].artist.c_str(),
191 entries[i].album.c_str()); 191 entries[i].album.c_str());
192 xml += entry_string; 192 xml += entry_string;
193 } 193 }
194 xml += "</dict></dict></plist>\n"; 194 xml += "</dict></dict></plist>\n";
195 ASSERT_EQ(static_cast<int>(xml.size()), 195 ASSERT_EQ(static_cast<int>(xml.size()),
196 file_util::WriteFile(XmlFile(), xml.c_str(), xml.size())); 196 base::WriteFile(XmlFile(), xml.c_str(), xml.size()));
197 } 197 }
198 198
199 base::ScopedTempDir library_dir_; 199 base::ScopedTempDir library_dir_;
200 200
201 base::Closure library_changed_callback_; 201 base::Closure library_changed_callback_;
202 202
203 base::Closure quit_closure_; 203 base::Closure quit_closure_;
204 204
205 DISALLOW_COPY_AND_ASSIGN(ITunesDataProviderTest); 205 DISALLOW_COPY_AND_ASSIGN(ITunesDataProviderTest);
206 }; 206 };
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 } 336 }
337 337
338 virtual void StartTest(bool parse_success) OVERRIDE { 338 virtual void StartTest(bool parse_success) OVERRIDE {
339 EXPECT_TRUE(parse_success); 339 EXPECT_TRUE(parse_success);
340 340
341 SetLibraryChangeCallback( 341 SetLibraryChangeCallback(
342 base::Bind(&ITunesDataProvider::RefreshData, 342 base::Bind(&ITunesDataProvider::RefreshData,
343 base::Unretained(data_provider()), 343 base::Unretained(data_provider()),
344 base::Bind(&ITunesDataProviderInvalidTest::CheckInvalid, 344 base::Bind(&ITunesDataProviderInvalidTest::CheckInvalid,
345 base::Unretained(this)))); 345 base::Unretained(this))));
346 ASSERT_EQ(1L, file_util::WriteFile(XmlFile(), " ", 1)); 346 ASSERT_EQ(1L, base::WriteFile(XmlFile(), " ", 1));
347 } 347 }
348 348
349 void CheckInvalid(bool is_valid) { 349 void CheckInvalid(bool is_valid) {
350 EXPECT_FALSE(is_valid); 350 EXPECT_FALSE(is_valid);
351 TestDone(); 351 TestDone();
352 } 352 }
353 353
354 private: 354 private:
355 DISALLOW_COPY_AND_ASSIGN(ITunesDataProviderInvalidTest); 355 DISALLOW_COPY_AND_ASSIGN(ITunesDataProviderInvalidTest);
356 }; 356 };
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 452
453 IN_PROC_BROWSER_TEST_F(ITunesDataProviderUniqueNameTest, UniqueNameTest) { 453 IN_PROC_BROWSER_TEST_F(ITunesDataProviderUniqueNameTest, UniqueNameTest) {
454 RunTest(); 454 RunTest();
455 } 455 }
456 456
457 IN_PROC_BROWSER_TEST_F(ITunesDataProviderEscapeTest, EscapeTest) { 457 IN_PROC_BROWSER_TEST_F(ITunesDataProviderEscapeTest, EscapeTest) {
458 RunTest(); 458 RunTest();
459 } 459 }
460 460
461 } // namespace itunes 461 } // namespace itunes
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698