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 |
60 // Start a test server for net/data/test.html access. | 64 // Start a test server for net/data/test.html access. |
61 net::SpawnedTestServer server( | 65 net::SpawnedTestServer server( |
62 net::SpawnedTestServer::TYPE_HTTP, net::SpawnedTestServer::kLocalhost, | 66 net::SpawnedTestServer::TYPE_HTTP, net::SpawnedTestServer::kLocalhost, |
63 base::FilePath(FILE_PATH_LITERAL("net/data"))); | 67 base::FilePath(FILE_PATH_LITERAL("net/data"))); |
64 ASSERT_TRUE(server.Start()); | 68 ASSERT_TRUE(server.Start()); |
65 | 69 |
66 // Connect to the URL through the mojo:html_viewer content handler. | 70 // Connect to the URL through the mojo:html_viewer content handler. |
67 const uint16_t assigned_port = server.host_port_pair().port(); | 71 const uint16_t assigned_port = server.host_port_pair().port(); |
68 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 72 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
69 request->url = mojo::String::From( | 73 request->url = mojo::String::From( |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 EXPECT_TRUE(QuitRunLoop()); | 107 EXPECT_TRUE(QuitRunLoop()); |
104 }); | 108 }); |
105 ASSERT_TRUE(DoRunLoopWithTimeout()); | 109 ASSERT_TRUE(DoRunLoopWithTimeout()); |
106 | 110 |
107 EXPECT_TRUE(AxTreeContainsText(ax_tree, "Hello ")); | 111 EXPECT_TRUE(AxTreeContainsText(ax_tree, "Hello ")); |
108 EXPECT_TRUE(AxTreeContainsText(ax_tree, "World!")); | 112 EXPECT_TRUE(AxTreeContainsText(ax_tree, "World!")); |
109 EXPECT_FALSE(AxTreeContainsText(ax_tree, "foo")); | 113 EXPECT_FALSE(AxTreeContainsText(ax_tree, "foo")); |
110 } | 114 } |
111 | 115 |
112 } // namespace mojo | 116 } // namespace mojo |
OLD | NEW |