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 #include "chrome/test/base/ui_test_utils.h" | 5 #include "chrome/test/base/ui_test_utils.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "chrome/test/base/find_in_page_observer.h" | 42 #include "chrome/test/base/find_in_page_observer.h" |
43 #include "components/app_modal/app_modal_dialog.h" | 43 #include "components/app_modal/app_modal_dialog.h" |
44 #include "components/app_modal/app_modal_dialog_queue.h" | 44 #include "components/app_modal/app_modal_dialog_queue.h" |
45 #include "components/bookmarks/browser/bookmark_model.h" | 45 #include "components/bookmarks/browser/bookmark_model.h" |
46 #include "components/history/core/browser/history_service_observer.h" | 46 #include "components/history/core/browser/history_service_observer.h" |
47 #include "components/omnibox/browser/autocomplete_controller.h" | 47 #include "components/omnibox/browser/autocomplete_controller.h" |
48 #include "components/omnibox/browser/omnibox_edit_model.h" | 48 #include "components/omnibox/browser/omnibox_edit_model.h" |
49 #include "components/prefs/pref_service.h" | 49 #include "components/prefs/pref_service.h" |
50 #include "content/public/browser/download_item.h" | 50 #include "content/public/browser/download_item.h" |
51 #include "content/public/browser/download_manager.h" | 51 #include "content/public/browser/download_manager.h" |
52 #include "content/public/browser/geolocation_provider.h" | |
53 #include "content/public/browser/navigation_controller.h" | 52 #include "content/public/browser/navigation_controller.h" |
54 #include "content/public/browser/navigation_entry.h" | 53 #include "content/public/browser/navigation_entry.h" |
55 #include "content/public/browser/notification_service.h" | 54 #include "content/public/browser/notification_service.h" |
56 #include "content/public/browser/render_process_host.h" | 55 #include "content/public/browser/render_process_host.h" |
57 #include "content/public/browser/storage_partition.h" | 56 #include "content/public/browser/storage_partition.h" |
58 #include "content/public/browser/web_contents.h" | 57 #include "content/public/browser/web_contents.h" |
59 #include "content/public/browser/web_contents_observer.h" | 58 #include "content/public/browser/web_contents_observer.h" |
60 #include "content/public/common/geoposition.h" | |
61 #include "content/public/common/resource_request_body.h" | 59 #include "content/public/common/resource_request_body.h" |
62 #include "content/public/test/browser_test_utils.h" | 60 #include "content/public/test/browser_test_utils.h" |
63 #include "content/public/test/download_test_observer.h" | 61 #include "content/public/test/download_test_observer.h" |
64 #include "content/public/test/test_navigation_observer.h" | 62 #include "content/public/test/test_navigation_observer.h" |
65 #include "content/public/test/test_utils.h" | 63 #include "content/public/test/test_utils.h" |
| 64 #include "device/geolocation/geolocation_provider.h" |
| 65 #include "device/geolocation/geoposition.h" |
66 #include "net/base/filename_util.h" | 66 #include "net/base/filename_util.h" |
67 #include "net/cookies/cookie_constants.h" | 67 #include "net/cookies/cookie_constants.h" |
68 #include "net/cookies/cookie_monster.h" | 68 #include "net/cookies/cookie_monster.h" |
69 #include "net/cookies/cookie_store.h" | 69 #include "net/cookies/cookie_store.h" |
70 #include "net/test/python_utils.h" | 70 #include "net/test/python_utils.h" |
71 #include "net/url_request/url_request_context.h" | 71 #include "net/url_request/url_request_context.h" |
72 #include "net/url_request/url_request_context_getter.h" | 72 #include "net/url_request/url_request_context_getter.h" |
73 #include "ui/gfx/geometry/rect.h" | 73 #include "ui/gfx/geometry/rect.h" |
74 | 74 |
75 #if defined(OS_WIN) | 75 #if defined(OS_WIN) |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 } | 461 } |
462 | 462 |
463 Browser* BrowserAddedObserver::WaitForSingleNewBrowser() { | 463 Browser* BrowserAddedObserver::WaitForSingleNewBrowser() { |
464 notification_observer_.Wait(); | 464 notification_observer_.Wait(); |
465 // Ensure that only a single new browser has appeared. | 465 // Ensure that only a single new browser has appeared. |
466 EXPECT_EQ(original_browsers_.size() + 1, chrome::GetTotalBrowserCount()); | 466 EXPECT_EQ(original_browsers_.size() + 1, chrome::GetTotalBrowserCount()); |
467 return GetBrowserNotInSet(original_browsers_); | 467 return GetBrowserNotInSet(original_browsers_); |
468 } | 468 } |
469 | 469 |
470 void OverrideGeolocation(double latitude, double longitude) { | 470 void OverrideGeolocation(double latitude, double longitude) { |
471 content::Geoposition position; | 471 device::Geoposition position; |
472 position.latitude = latitude; | 472 position.latitude = latitude; |
473 position.longitude = longitude; | 473 position.longitude = longitude; |
474 position.altitude = 0.; | 474 position.altitude = 0.; |
475 position.accuracy = 0.; | 475 position.accuracy = 0.; |
476 position.timestamp = base::Time::Now(); | 476 position.timestamp = base::Time::Now(); |
477 content::GeolocationProvider::GetInstance()->OverrideLocationForTesting( | 477 device::GeolocationProvider::GetInstance()->OverrideLocationForTesting( |
478 position); | 478 position); |
479 } | 479 } |
480 | 480 |
481 HistoryEnumerator::HistoryEnumerator(Profile* profile) { | 481 HistoryEnumerator::HistoryEnumerator(Profile* profile) { |
482 scoped_refptr<content::MessageLoopRunner> message_loop_runner = | 482 scoped_refptr<content::MessageLoopRunner> message_loop_runner = |
483 new content::MessageLoopRunner; | 483 new content::MessageLoopRunner; |
484 | 484 |
485 history::HistoryService* hs = HistoryServiceFactory::GetForProfile( | 485 history::HistoryService* hs = HistoryServiceFactory::GetForProfile( |
486 profile, ServiceAccessType::EXPLICIT_ACCESS); | 486 profile, ServiceAccessType::EXPLICIT_ACCESS); |
487 hs->QueryHistory(base::string16(), | 487 hs->QueryHistory(base::string16(), |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 new content::MessageLoopRunner; | 536 new content::MessageLoopRunner; |
537 WaitHistoryLoadedObserver observer(runner.get()); | 537 WaitHistoryLoadedObserver observer(runner.get()); |
538 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> | 538 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> |
539 scoped_observer(&observer); | 539 scoped_observer(&observer); |
540 scoped_observer.Add(history_service); | 540 scoped_observer.Add(history_service); |
541 runner->Run(); | 541 runner->Run(); |
542 } | 542 } |
543 } | 543 } |
544 | 544 |
545 } // namespace ui_test_utils | 545 } // namespace ui_test_utils |
OLD | NEW |