OLD | NEW |
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 #ifndef CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 5 #ifndef CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
6 #define CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 6 #define CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <set> | 10 #include <set> |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 263 |
264 DISALLOW_COPY_AND_ASSIGN(BrowserAddedObserver); | 264 DISALLOW_COPY_AND_ASSIGN(BrowserAddedObserver); |
265 }; | 265 }; |
266 | 266 |
267 // Takes a snapshot of the entire page, according to the width and height | 267 // Takes a snapshot of the entire page, according to the width and height |
268 // properties of the DOM's document. Returns true on success. DOMAutomation | 268 // properties of the DOM's document. Returns true on success. DOMAutomation |
269 // must be enabled. | 269 // must be enabled. |
270 bool TakeEntirePageSnapshot(content::RenderViewHost* rvh, | 270 bool TakeEntirePageSnapshot(content::RenderViewHost* rvh, |
271 SkBitmap* bitmap) WARN_UNUSED_RESULT; | 271 SkBitmap* bitmap) WARN_UNUSED_RESULT; |
272 | 272 |
273 #if defined(OS_WIN) | |
274 // Saves a snapshot of the entire screen to a file named | |
275 // ChromiumSnapshotYYYYMMDDHHMMSS.png to |directory|, returning true on success. | |
276 // The path to the file produced is returned in |screenshot_path| if non-NULL. | |
277 bool SaveScreenSnapshotToDirectory(const base::FilePath& directory, | |
278 base::FilePath* screenshot_path); | |
279 | |
280 // Saves a snapshot of the entire screen as above to the current user's desktop. | |
281 // The Chrome path provider must be registered prior to calling this function. | |
282 bool SaveScreenSnapshotToDesktop(base::FilePath* screenshot_path); | |
283 #endif | |
284 | |
285 // Configures the geolocation provider to always return the given position. | 273 // Configures the geolocation provider to always return the given position. |
286 void OverrideGeolocation(double latitude, double longitude); | 274 void OverrideGeolocation(double latitude, double longitude); |
287 | 275 |
288 // Enumerates all history contents on the backend thread. Returns them in | 276 // Enumerates all history contents on the backend thread. Returns them in |
289 // descending order by time. | 277 // descending order by time. |
290 class HistoryEnumerator { | 278 class HistoryEnumerator { |
291 public: | 279 public: |
292 explicit HistoryEnumerator(Profile* profile); | 280 explicit HistoryEnumerator(Profile* profile); |
293 ~HistoryEnumerator(); | 281 ~HistoryEnumerator(); |
294 | 282 |
295 std::vector<GURL>& urls() { return urls_; } | 283 std::vector<GURL>& urls() { return urls_; } |
296 | 284 |
297 private: | 285 private: |
298 void HistoryQueryComplete( | 286 void HistoryQueryComplete( |
299 const base::Closure& quit_task, | 287 const base::Closure& quit_task, |
300 history::QueryResults* results); | 288 history::QueryResults* results); |
301 | 289 |
302 std::vector<GURL> urls_; | 290 std::vector<GURL> urls_; |
303 | 291 |
304 base::CancelableTaskTracker tracker_; | 292 base::CancelableTaskTracker tracker_; |
305 | 293 |
306 DISALLOW_COPY_AND_ASSIGN(HistoryEnumerator); | 294 DISALLOW_COPY_AND_ASSIGN(HistoryEnumerator); |
307 }; | 295 }; |
308 | 296 |
309 } // namespace ui_test_utils | 297 } // namespace ui_test_utils |
310 | 298 |
311 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 299 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
OLD | NEW |