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

Side by Side Diff: chrome/test/base/ui_test_utils.cc

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | « chrome/test/base/testing_profile.cc ('k') | chrome/test/base/v8_unit_test.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) 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/test/base/ui_test_utils.h" 5 #include "chrome/test/base/ui_test_utils.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #endif 9 #endif
10 10
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 base::FilePath GetSnapshotFileName(const base::FilePath& snapshot_directory) { 103 base::FilePath GetSnapshotFileName(const base::FilePath& snapshot_directory) {
104 base::Time::Exploded the_time; 104 base::Time::Exploded the_time;
105 105
106 base::Time::Now().LocalExplode(&the_time); 106 base::Time::Now().LocalExplode(&the_time);
107 std::string filename(base::StringPrintf("%s%04d%02d%02d%02d%02d%02d%s", 107 std::string filename(base::StringPrintf("%s%04d%02d%02d%02d%02d%02d%s",
108 kSnapshotBaseName, the_time.year, the_time.month, the_time.day_of_month, 108 kSnapshotBaseName, the_time.year, the_time.month, the_time.day_of_month,
109 the_time.hour, the_time.minute, the_time.second, kSnapshotExtension)); 109 the_time.hour, the_time.minute, the_time.second, kSnapshotExtension));
110 110
111 base::FilePath snapshot_file = snapshot_directory.AppendASCII(filename); 111 base::FilePath snapshot_file = snapshot_directory.AppendASCII(filename);
112 if (file_util::PathExists(snapshot_file)) { 112 if (base::PathExists(snapshot_file)) {
113 int index = 0; 113 int index = 0;
114 std::string suffix; 114 std::string suffix;
115 base::FilePath trial_file; 115 base::FilePath trial_file;
116 do { 116 do {
117 suffix = base::StringPrintf(" (%d)", ++index); 117 suffix = base::StringPrintf(" (%d)", ++index);
118 trial_file = snapshot_file.InsertBeforeExtensionASCII(suffix); 118 trial_file = snapshot_file.InsertBeforeExtensionASCII(suffix);
119 } while (file_util::PathExists(trial_file)); 119 } while (base::PathExists(trial_file));
120 snapshot_file = trial_file; 120 snapshot_file = trial_file;
121 } 121 }
122 return snapshot_file; 122 return snapshot_file;
123 } 123 }
124 124
125 } // namespace 125 } // namespace
126 126
127 bool GetCurrentTabTitle(const Browser* browser, string16* title) { 127 bool GetCurrentTabTitle(const Browser* browser, string16* title) {
128 WebContents* web_contents = 128 WebContents* web_contents =
129 browser->tab_strip_model()->GetActiveWebContents(); 129 browser->tab_strip_model()->GetActiveWebContents();
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 void HistoryEnumerator::HistoryQueryComplete( 550 void HistoryEnumerator::HistoryQueryComplete(
551 const base::Closure& quit_task, 551 const base::Closure& quit_task,
552 HistoryService::Handle request_handle, 552 HistoryService::Handle request_handle,
553 history::QueryResults* results) { 553 history::QueryResults* results) {
554 for (size_t i = 0; i < results->size(); ++i) 554 for (size_t i = 0; i < results->size(); ++i)
555 urls_.push_back((*results)[i].url()); 555 urls_.push_back((*results)[i].url());
556 quit_task.Run(); 556 quit_task.Run();
557 } 557 }
558 558
559 } // namespace ui_test_utils 559 } // namespace ui_test_utils
OLDNEW
« no previous file with comments | « chrome/test/base/testing_profile.cc ('k') | chrome/test/base/v8_unit_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698