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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_remover_unittest.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/browsing_data/browsing_data_remover.h" 5 #include "chrome/browser/browsing_data/browsing_data_remover.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 } 555 }
556 556
557 void AddDOMStorageTestData() { 557 void AddDOMStorageTestData() {
558 // Note: This test depends on details of how the dom_storage library 558 // Note: This test depends on details of how the dom_storage library
559 // stores data in the host file system. 559 // stores data in the host file system.
560 base::FilePath storage_path = 560 base::FilePath storage_path =
561 profile_->GetPath().AppendASCII("Local Storage"); 561 profile_->GetPath().AppendASCII("Local Storage");
562 base::CreateDirectory(storage_path); 562 base::CreateDirectory(storage_path);
563 563
564 // Write some files. 564 // Write some files.
565 file_util::WriteFile(storage_path.Append(kDomStorageOrigin1), NULL, 0); 565 base::WriteFile(storage_path.Append(kDomStorageOrigin1), NULL, 0);
566 file_util::WriteFile(storage_path.Append(kDomStorageOrigin2), NULL, 0); 566 base::WriteFile(storage_path.Append(kDomStorageOrigin2), NULL, 0);
567 file_util::WriteFile(storage_path.Append(kDomStorageOrigin3), NULL, 0); 567 base::WriteFile(storage_path.Append(kDomStorageOrigin3), NULL, 0);
568 file_util::WriteFile(storage_path.Append(kDomStorageExt), NULL, 0); 568 base::WriteFile(storage_path.Append(kDomStorageExt), NULL, 0);
569 569
570 // Tweak their dates. 570 // Tweak their dates.
571 base::Time now = base::Time::Now(); 571 base::Time now = base::Time::Now();
572 base::TouchFile(storage_path.Append(kDomStorageOrigin1), now, now); 572 base::TouchFile(storage_path.Append(kDomStorageOrigin1), now, now);
573 573
574 base::Time one_day_ago = now - base::TimeDelta::FromDays(1); 574 base::Time one_day_ago = now - base::TimeDelta::FromDays(1);
575 base::TouchFile(storage_path.Append(kDomStorageOrigin2), 575 base::TouchFile(storage_path.Append(kDomStorageOrigin2),
576 one_day_ago, one_day_ago); 576 one_day_ago, one_day_ago);
577 577
578 base::Time sixty_days_ago = now - base::TimeDelta::FromDays(60); 578 base::Time sixty_days_ago = now - base::TimeDelta::FromDays(60);
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after
1596 EXPECT_CALL(*cryptohome_client, TpmAttestationDeleteKeys(_, _, _, _)) 1596 EXPECT_CALL(*cryptohome_client, TpmAttestationDeleteKeys(_, _, _, _))
1597 .WillOnce(WithArgs<3>(Invoke(FakeDBusCall))); 1597 .WillOnce(WithArgs<3>(Invoke(FakeDBusCall)));
1598 1598
1599 BlockUntilBrowsingDataRemoved( 1599 BlockUntilBrowsingDataRemoved(
1600 BrowsingDataRemover::EVERYTHING, 1600 BrowsingDataRemover::EVERYTHING,
1601 BrowsingDataRemover::REMOVE_CONTENT_LICENSES, false); 1601 BrowsingDataRemover::REMOVE_CONTENT_LICENSES, false);
1602 1602
1603 chromeos::DBusThreadManager::Shutdown(); 1603 chromeos::DBusThreadManager::Shutdown();
1604 } 1604 }
1605 #endif 1605 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698