OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
6 #include "base/location.h" | 6 #include "base/location.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 return url; | 58 return url; |
59 } | 59 } |
60 | 60 |
61 void StartEmbeddedTestServer() { | 61 void StartEmbeddedTestServer() { |
62 base::FilePath test_data; | 62 base::FilePath test_data; |
63 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data)); | 63 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data)); |
64 embedded_test_server()->ServeFilesFromDirectory( | 64 embedded_test_server()->ServeFilesFromDirectory( |
65 test_data.AppendASCII("extensions/api_test") | 65 test_data.AppendASCII("extensions/api_test") |
66 .AppendASCII(kSitesDir)); | 66 .AppendASCII(kSitesDir)); |
67 ASSERT_TRUE(ExtensionApiTest::StartEmbeddedTestServer()); | 67 ASSERT_TRUE(ExtensionApiTest::StartEmbeddedTestServer()); |
68 host_resolver()->AddRule("*", embedded_test_server()->base_url().host()); | |
69 } | 68 } |
70 | 69 |
71 public: | 70 public: |
72 void SetUpInProcessBrowserTestFixture() override { | 71 void SetUpOnMainThread() override { |
73 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | 72 ExtensionApiTest::SetUpOnMainThread(); |
| 73 host_resolver()->AddRule("*", "127.0.0.1"); |
74 } | 74 } |
75 }; | 75 }; |
76 | 76 |
77 IN_PROC_BROWSER_TEST_F(AutomationApiTest, TestRendererAccessibilityEnabled) { | 77 IN_PROC_BROWSER_TEST_F(AutomationApiTest, TestRendererAccessibilityEnabled) { |
78 StartEmbeddedTestServer(); | 78 StartEmbeddedTestServer(); |
79 const GURL url = GetURLForPath(kDomain, "/index.html"); | 79 const GURL url = GetURLForPath(kDomain, "/index.html"); |
80 ui_test_utils::NavigateToURL(browser(), url); | 80 ui_test_utils::NavigateToURL(browser(), url); |
81 | 81 |
82 ASSERT_EQ(1, browser()->tab_strip_model()->count()); | 82 ASSERT_EQ(1, browser()->tab_strip_model()->count()); |
83 content::WebContents* const tab = | 83 content::WebContents* const tab = |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 << message_; | 290 << message_; |
291 } | 291 } |
292 | 292 |
293 IN_PROC_BROWSER_TEST_F(AutomationApiTest, HitTest) { | 293 IN_PROC_BROWSER_TEST_F(AutomationApiTest, HitTest) { |
294 StartEmbeddedTestServer(); | 294 StartEmbeddedTestServer(); |
295 ASSERT_TRUE(RunExtensionSubtest("automation/tests/tabs", "hit_test.html")) | 295 ASSERT_TRUE(RunExtensionSubtest("automation/tests/tabs", "hit_test.html")) |
296 << message_; | 296 << message_; |
297 } | 297 } |
298 | 298 |
299 } // namespace extensions | 299 } // namespace extensions |
OLD | NEW |