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/browser/devtools/device/adb/mock_adb_server.h" |
5 #include "chrome/browser/devtools/device/devtools_android_bridge.h" | 6 #include "chrome/browser/devtools/device/devtools_android_bridge.h" |
6 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
7 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 8 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
8 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
9 #include "chrome/test/base/ui_test_utils.h" | 10 #include "chrome/test/base/ui_test_utils.h" |
10 #include "chrome/test/base/web_ui_browsertest.h" | 11 #include "chrome/test/base/web_ui_browsertest.h" |
11 #include "content/public/browser/navigation_details.h" | 12 #include "content/public/browser/navigation_details.h" |
12 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
13 #include "content/public/test/browser_test_utils.h" | 14 #include "content/public/test/browser_test_utils.h" |
14 | 15 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 "testTargetListed", | 65 "testTargetListed", |
65 new base::StringValue("#pages"), | 66 new base::StringValue("#pages"), |
66 new base::StringValue("populateWebContentsTargets"), | 67 new base::StringValue("populateWebContentsTargets"), |
67 new base::StringValue(kSharedWorkerTestPage))); | 68 new base::StringValue(kSharedWorkerTestPage))); |
68 } | 69 } |
69 | 70 |
70 IN_PROC_BROWSER_TEST_F(InspectUITest, AndroidTargets) { | 71 IN_PROC_BROWSER_TEST_F(InspectUITest, AndroidTargets) { |
71 scoped_refptr<DevToolsAndroidBridge> android_bridge = | 72 scoped_refptr<DevToolsAndroidBridge> android_bridge = |
72 DevToolsAndroidBridge::Factory::GetForProfile(browser()->profile()); | 73 DevToolsAndroidBridge::Factory::GetForProfile(browser()->profile()); |
73 AndroidDeviceManager::DeviceProviders providers; | 74 AndroidDeviceManager::DeviceProviders providers; |
74 providers.push_back(AndroidDeviceManager::GetMockDeviceProviderForTest()); | 75 providers.push_back(AndroidDeviceManager::GetAdbDeviceProvider()); |
75 android_bridge->set_device_providers_for_test(providers); | 76 android_bridge->set_device_providers_for_test(providers); |
76 | 77 |
| 78 StartMockAdbServer(); |
| 79 |
77 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIInspectURL)); | 80 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIInspectURL)); |
78 | 81 |
79 ASSERT_TRUE(WebUIBrowserTest::RunJavascriptAsyncTest("testAdbTargetsListed")); | 82 ASSERT_TRUE(WebUIBrowserTest::RunJavascriptAsyncTest("testAdbTargetsListed")); |
| 83 |
| 84 StopMockAdbServer(); |
80 } | 85 } |
81 | 86 |
82 IN_PROC_BROWSER_TEST_F(InspectUITest, ReloadCrash) { | 87 IN_PROC_BROWSER_TEST_F(InspectUITest, ReloadCrash) { |
83 ASSERT_TRUE(test_server()->Start()); | 88 ASSERT_TRUE(test_server()->Start()); |
84 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIInspectURL)); | 89 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIInspectURL)); |
85 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIInspectURL)); | 90 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIInspectURL)); |
86 } | 91 } |
87 | 92 |
88 } // namespace | 93 } // namespace |
OLD | NEW |