| 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/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 namespace { | 42 namespace { |
| 43 static const char kDomain[] = "a.com"; | 43 static const char kDomain[] = "a.com"; |
| 44 static const char kSitesDir[] = "automation/sites"; | 44 static const char kSitesDir[] = "automation/sites"; |
| 45 static const char kGotTree[] = "got_tree"; | 45 static const char kGotTree[] = "got_tree"; |
| 46 } // anonymous namespace | 46 } // anonymous namespace |
| 47 | 47 |
| 48 class AutomationApiTest : public ExtensionApiTest { | 48 class AutomationApiTest : public ExtensionApiTest { |
| 49 protected: | 49 protected: |
| 50 GURL GetURLForPath(const std::string& host, const std::string& path) { | 50 GURL GetURLForPath(const std::string& host, const std::string& path) { |
| 51 std::string port = base::IntToString(embedded_test_server()->port()); | 51 std::string port = base::UintToString(embedded_test_server()->port()); |
| 52 GURL::Replacements replacements; | 52 GURL::Replacements replacements; |
| 53 replacements.SetHostStr(host); | 53 replacements.SetHostStr(host); |
| 54 replacements.SetPortStr(port); | 54 replacements.SetPortStr(port); |
| 55 GURL url = | 55 GURL url = |
| 56 embedded_test_server()->GetURL(path).ReplaceComponents(replacements); | 56 embedded_test_server()->GetURL(path).ReplaceComponents(replacements); |
| 57 return url; | 57 return url; |
| 58 } | 58 } |
| 59 | 59 |
| 60 void StartEmbeddedTestServer() { | 60 void StartEmbeddedTestServer() { |
| 61 base::FilePath test_data; | 61 base::FilePath test_data; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 << message_; | 206 << message_; |
| 207 } | 207 } |
| 208 | 208 |
| 209 IN_PROC_BROWSER_TEST_F(AutomationApiTest, TreeChange) { | 209 IN_PROC_BROWSER_TEST_F(AutomationApiTest, TreeChange) { |
| 210 StartEmbeddedTestServer(); | 210 StartEmbeddedTestServer(); |
| 211 ASSERT_TRUE(RunExtensionSubtest("automation/tests/tabs", "tree_change.html")) | 211 ASSERT_TRUE(RunExtensionSubtest("automation/tests/tabs", "tree_change.html")) |
| 212 << message_; | 212 << message_; |
| 213 } | 213 } |
| 214 | 214 |
| 215 } // namespace extensions | 215 } // namespace extensions |
| OLD | NEW |