OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
10 #include "components/view_manager/public/cpp/tests/view_manager_test_base.h" | 10 #include "components/view_manager/public/cpp/tests/view_manager_test_base.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 private: | 51 private: |
52 DISALLOW_COPY_AND_ASSIGN(TestFrameTreeServer); | 52 DISALLOW_COPY_AND_ASSIGN(TestFrameTreeServer); |
53 }; | 53 }; |
54 | 54 |
55 } // namespace | 55 } // namespace |
56 | 56 |
57 using AXProviderTest = ViewManagerTestBase; | 57 using AXProviderTest = ViewManagerTestBase; |
58 | 58 |
59 TEST_F(AXProviderTest, HelloWorld) { | 59 TEST_F(AXProviderTest, HelloWorld) { |
60 // TODO(msw|sky): Fix flaky timeouts without oopifs; http://crbug.com/504917 | |
61 if (!EnableOOPIFs()) | |
62 return; | |
63 | |
64 // Start a test server for net/data/test.html access. | 60 // Start a test server for net/data/test.html access. |
65 net::SpawnedTestServer server( | 61 net::SpawnedTestServer server( |
66 net::SpawnedTestServer::TYPE_HTTP, net::SpawnedTestServer::kLocalhost, | 62 net::SpawnedTestServer::TYPE_HTTP, net::SpawnedTestServer::kLocalhost, |
67 base::FilePath(FILE_PATH_LITERAL("net/data"))); | 63 base::FilePath(FILE_PATH_LITERAL("net/data"))); |
68 ASSERT_TRUE(server.Start()); | 64 ASSERT_TRUE(server.Start()); |
69 | 65 |
70 // Connect to the URL through the mojo:html_viewer content handler. | 66 // Connect to the URL through the mojo:html_viewer content handler. |
71 const uint16_t assigned_port = server.host_port_pair().port(); | 67 const uint16_t assigned_port = server.host_port_pair().port(); |
72 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 68 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
73 request->url = mojo::String::From( | 69 request->url = mojo::String::From( |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 EXPECT_TRUE(QuitRunLoop()); | 103 EXPECT_TRUE(QuitRunLoop()); |
108 }); | 104 }); |
109 ASSERT_TRUE(DoRunLoopWithTimeout()); | 105 ASSERT_TRUE(DoRunLoopWithTimeout()); |
110 | 106 |
111 EXPECT_TRUE(AxTreeContainsText(ax_tree, "Hello ")); | 107 EXPECT_TRUE(AxTreeContainsText(ax_tree, "Hello ")); |
112 EXPECT_TRUE(AxTreeContainsText(ax_tree, "World!")); | 108 EXPECT_TRUE(AxTreeContainsText(ax_tree, "World!")); |
113 EXPECT_FALSE(AxTreeContainsText(ax_tree, "foo")); | 109 EXPECT_FALSE(AxTreeContainsText(ax_tree, "foo")); |
114 } | 110 } |
115 | 111 |
116 } // namespace mojo | 112 } // namespace mojo |
OLD | NEW |