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

Side by Side Diff: chrome/browser/media_galleries/fileapi/iphoto_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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 DCHECK(MediaFileSystemBackend::CurrentlyOnMediaTaskRunnerThread()); 134 DCHECK(MediaFileSystemBackend::CurrentlyOnMediaTaskRunnerThread());
135 if (!library_changed_callback_.is_null()) { 135 if (!library_changed_callback_.is_null()) {
136 library_changed_callback_.Run(); 136 library_changed_callback_.Run();
137 library_changed_callback_.Reset(); 137 library_changed_callback_.Reset();
138 } 138 }
139 } 139 }
140 140
141 void WriteLibraryInternal() { 141 void WriteLibraryInternal() {
142 std::string xml = GetLibraryString(); 142 std::string xml = GetLibraryString();
143 ASSERT_EQ(static_cast<int>(xml.size()), 143 ASSERT_EQ(static_cast<int>(xml.size()),
144 file_util::WriteFile(XmlFile(), xml.c_str(), xml.size())); 144 base::WriteFile(XmlFile(), xml.c_str(), xml.size()));
145 } 145 }
146 146
147 base::ScopedTempDir library_dir_; 147 base::ScopedTempDir library_dir_;
148 148
149 base::Closure library_changed_callback_; 149 base::Closure library_changed_callback_;
150 150
151 base::Closure quit_closure_; 151 base::Closure quit_closure_;
152 152
153 DISALLOW_COPY_AND_ASSIGN(IPhotoDataProviderTest); 153 DISALLOW_COPY_AND_ASSIGN(IPhotoDataProviderTest);
154 }; 154 };
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 virtual ~IPhotoDataProviderInvalidTest() {} 444 virtual ~IPhotoDataProviderInvalidTest() {}
445 445
446 virtual void StartTest(bool parse_success) OVERRIDE { 446 virtual void StartTest(bool parse_success) OVERRIDE {
447 EXPECT_TRUE(parse_success); 447 EXPECT_TRUE(parse_success);
448 448
449 SetLibraryChangeCallback( 449 SetLibraryChangeCallback(
450 base::Bind(&IPhotoDataProvider::RefreshData, 450 base::Bind(&IPhotoDataProvider::RefreshData,
451 base::Unretained(data_provider()), 451 base::Unretained(data_provider()),
452 base::Bind(&IPhotoDataProviderInvalidTest::CheckInvalid, 452 base::Bind(&IPhotoDataProviderInvalidTest::CheckInvalid,
453 base::Unretained(this)))); 453 base::Unretained(this))));
454 EXPECT_EQ(1L, file_util::WriteFile(XmlFile(), " ", 1)); 454 EXPECT_EQ(1L, base::WriteFile(XmlFile(), " ", 1));
455 } 455 }
456 456
457 void CheckInvalid(bool is_valid) { 457 void CheckInvalid(bool is_valid) {
458 EXPECT_FALSE(is_valid); 458 EXPECT_FALSE(is_valid);
459 TestDone(); 459 TestDone();
460 } 460 }
461 461
462 private: 462 private:
463 DISALLOW_COPY_AND_ASSIGN(IPhotoDataProviderInvalidTest); 463 DISALLOW_COPY_AND_ASSIGN(IPhotoDataProviderInvalidTest);
464 }; 464 };
465 465
466 IN_PROC_BROWSER_TEST_F(IPhotoDataProviderBasicTest, BasicTest) { 466 IN_PROC_BROWSER_TEST_F(IPhotoDataProviderBasicTest, BasicTest) {
467 RunTest(); 467 RunTest();
468 } 468 }
469 469
470 IN_PROC_BROWSER_TEST_F(IPhotoDataProviderRefreshTest, RefreshTest) { 470 IN_PROC_BROWSER_TEST_F(IPhotoDataProviderRefreshTest, RefreshTest) {
471 RunTest(); 471 RunTest();
472 } 472 }
473 473
474 IN_PROC_BROWSER_TEST_F(IPhotoDataProviderInvalidTest, InvalidTest) { 474 IN_PROC_BROWSER_TEST_F(IPhotoDataProviderInvalidTest, InvalidTest) {
475 RunTest(); 475 RunTest();
476 } 476 }
477 477
478 } // namespace iphoto 478 } // namespace iphoto
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698