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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 // Connect to the URL through the mojo:html_viewer content handler. | 73 // Connect to the URL through the mojo:html_viewer content handler. |
74 const uint16_t assigned_port = server.host_port_pair().port(); | 74 const uint16_t assigned_port = server.host_port_pair().port(); |
75 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 75 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
76 request->url = mojo::String::From( | 76 request->url = mojo::String::From( |
77 base::StringPrintf("http://127.0.0.1:%u/files/test.html", assigned_port)); | 77 base::StringPrintf("http://127.0.0.1:%u/files/test.html", assigned_port)); |
78 scoped_ptr<ApplicationConnection> connection = | 78 scoped_ptr<ApplicationConnection> connection = |
79 application_impl()->ConnectToApplication(request.Pass()); | 79 application_impl()->ConnectToApplication(request.Pass()); |
80 | 80 |
81 // Embed the html_viewer in a View. | 81 // Embed the html_viewer in a View. |
82 ViewManagerClientPtr view_manager_client; | 82 ViewTreeClientPtr tree_client; |
83 connection->ConnectToService(&view_manager_client); | 83 connection->ConnectToService(&tree_client); |
84 View* embed_view = window_manager()->CreateView(); | 84 View* embed_view = window_manager()->CreateView(); |
85 embed_view->Embed(view_manager_client.Pass()); | 85 embed_view->Embed(tree_client.Pass()); |
86 | 86 |
87 TestFrameTreeServer frame_tree_server; | 87 TestFrameTreeServer frame_tree_server; |
88 mandoline::FrameTreeServerPtr frame_tree_server_ptr; | 88 mandoline::FrameTreeServerPtr frame_tree_server_ptr; |
89 mojo::Binding<mandoline::FrameTreeServer> frame_tree_server_binding( | 89 mojo::Binding<mandoline::FrameTreeServer> frame_tree_server_binding( |
90 &frame_tree_server); | 90 &frame_tree_server); |
91 frame_tree_server_binding.Bind(GetProxy(&frame_tree_server_ptr).Pass()); | 91 frame_tree_server_binding.Bind(GetProxy(&frame_tree_server_ptr).Pass()); |
92 | 92 |
93 mojo::Array<mandoline::FrameDataPtr> array(1u); | 93 mojo::Array<mandoline::FrameDataPtr> array(1u); |
94 array[0] = mandoline::FrameData::New().Pass(); | 94 array[0] = mandoline::FrameData::New().Pass(); |
95 array[0]->frame_id = embed_view->id(); | 95 array[0]->frame_id = embed_view->id(); |
(...skipping 13 matching lines...) Expand all Loading... |
109 EXPECT_TRUE(QuitRunLoop()); | 109 EXPECT_TRUE(QuitRunLoop()); |
110 }); | 110 }); |
111 ASSERT_TRUE(DoRunLoopWithTimeout()); | 111 ASSERT_TRUE(DoRunLoopWithTimeout()); |
112 | 112 |
113 EXPECT_TRUE(AxTreeContainsText(ax_tree, "Hello ")); | 113 EXPECT_TRUE(AxTreeContainsText(ax_tree, "Hello ")); |
114 EXPECT_TRUE(AxTreeContainsText(ax_tree, "World!")); | 114 EXPECT_TRUE(AxTreeContainsText(ax_tree, "World!")); |
115 EXPECT_FALSE(AxTreeContainsText(ax_tree, "foo")); | 115 EXPECT_FALSE(AxTreeContainsText(ax_tree, "foo")); |
116 } | 116 } |
117 | 117 |
118 } // namespace mojo | 118 } // namespace mojo |
OLD | NEW |