| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 net::SpawnedTestServer server( | 74 net::SpawnedTestServer server( |
| 75 net::SpawnedTestServer::TYPE_HTTP, net::SpawnedTestServer::kLocalhost, | 75 net::SpawnedTestServer::TYPE_HTTP, net::SpawnedTestServer::kLocalhost, |
| 76 base::FilePath(FILE_PATH_LITERAL("net/data"))); | 76 base::FilePath(FILE_PATH_LITERAL("net/data"))); |
| 77 ASSERT_TRUE(server.Start()); | 77 ASSERT_TRUE(server.Start()); |
| 78 | 78 |
| 79 // Connect to the URL through the mojo:html_viewer content handler. | 79 // Connect to the URL through the mojo:html_viewer content handler. |
| 80 const uint16_t assigned_port = server.host_port_pair().port(); | 80 const uint16_t assigned_port = server.host_port_pair().port(); |
| 81 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 81 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
| 82 request->url = mojo::String::From( | 82 request->url = mojo::String::From( |
| 83 base::StringPrintf("http://127.0.0.1:%u/files/test.html", assigned_port)); | 83 base::StringPrintf("http://127.0.0.1:%u/files/test.html", assigned_port)); |
| 84 ApplicationConnection* connection = application_impl()->ConnectToApplication( | 84 scoped_ptr<ApplicationConnection> connection = |
| 85 request.Pass()); | 85 application_impl()->ConnectToApplication(request.Pass()); |
| 86 | 86 |
| 87 // Embed the html_viewer in a View. | 87 // Embed the html_viewer in a View. |
| 88 ViewManagerClientPtr view_manager_client; | 88 ViewManagerClientPtr view_manager_client; |
| 89 connection->ConnectToService(&view_manager_client); | 89 connection->ConnectToService(&view_manager_client); |
| 90 View* embed_view = window_manager()->CreateView(); | 90 View* embed_view = window_manager()->CreateView(); |
| 91 embed_view->Embed(view_manager_client.Pass()); | 91 embed_view->Embed(view_manager_client.Pass()); |
| 92 | 92 |
| 93 if (EnableOOPIFs()) { | 93 if (EnableOOPIFs()) { |
| 94 TestFrameTreeServer frame_tree_server; | 94 TestFrameTreeServer frame_tree_server; |
| 95 mandoline::FrameTreeServerPtr frame_tree_server_ptr; | 95 mandoline::FrameTreeServerPtr frame_tree_server_ptr; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 116 EXPECT_TRUE(QuitRunLoop()); | 116 EXPECT_TRUE(QuitRunLoop()); |
| 117 }); | 117 }); |
| 118 ASSERT_TRUE(DoRunLoopWithTimeout()); | 118 ASSERT_TRUE(DoRunLoopWithTimeout()); |
| 119 | 119 |
| 120 EXPECT_TRUE(AxTreeContainsText(ax_tree, "Hello ")); | 120 EXPECT_TRUE(AxTreeContainsText(ax_tree, "Hello ")); |
| 121 EXPECT_TRUE(AxTreeContainsText(ax_tree, "World!")); | 121 EXPECT_TRUE(AxTreeContainsText(ax_tree, "World!")); |
| 122 EXPECT_FALSE(AxTreeContainsText(ax_tree, "foo")); | 122 EXPECT_FALSE(AxTreeContainsText(ax_tree, "foo")); |
| 123 } | 123 } |
| 124 | 124 |
| 125 } // namespace mojo | 125 } // namespace mojo |
| OLD | NEW |