| 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 "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 mojo::Array<web_view::mojom::FrameDataPtr> array(1u); | 99 mojo::Array<web_view::mojom::FrameDataPtr> array(1u); |
| 100 array[0] = web_view::mojom::FrameData::New().Pass(); | 100 array[0] = web_view::mojom::FrameData::New().Pass(); |
| 101 array[0]->frame_id = embed_window->id(); | 101 array[0]->frame_id = embed_window->id(); |
| 102 array[0]->parent_id = 0u; | 102 array[0]->parent_id = 0u; |
| 103 | 103 |
| 104 web_view::mojom::FrameClientPtr frame_client; | 104 web_view::mojom::FrameClientPtr frame_client; |
| 105 connection->ConnectToService(&frame_client); | 105 connection->ConnectToService(&frame_client); |
| 106 frame_client->OnConnect( | 106 frame_client->OnConnect( |
| 107 frame_ptr.Pass(), 1u, embed_window->id(), | 107 frame_ptr.Pass(), 1u, embed_window->id(), |
| 108 web_view::mojom::VIEW_CONNECT_TYPE_USE_NEW, array.Pass(), | 108 web_view::mojom::WINDOW_CONNECT_TYPE_USE_NEW, array.Pass(), |
| 109 base::TimeTicks::Now().ToInternalValue(), base::Closure()); | 109 base::TimeTicks::Now().ToInternalValue(), base::Closure()); |
| 110 | 110 |
| 111 // Connect to the AxProvider of the HTML document and get the AxTree. | 111 // Connect to the AxProvider of the HTML document and get the AxTree. |
| 112 AxProviderPtr ax_provider; | 112 AxProviderPtr ax_provider; |
| 113 connection->ConnectToService(&ax_provider); | 113 connection->ConnectToService(&ax_provider); |
| 114 Array<AxNodePtr> ax_tree; | 114 Array<AxNodePtr> ax_tree; |
| 115 ax_provider->GetTree([&ax_tree](Array<AxNodePtr> tree) { | 115 ax_provider->GetTree([&ax_tree](Array<AxNodePtr> tree) { |
| 116 ax_tree = tree.Pass(); | 116 ax_tree = tree.Pass(); |
| 117 EXPECT_TRUE(QuitRunLoop()); | 117 EXPECT_TRUE(QuitRunLoop()); |
| 118 }); | 118 }); |
| 119 ASSERT_TRUE(DoRunLoopWithTimeout()); | 119 ASSERT_TRUE(DoRunLoopWithTimeout()); |
| 120 | 120 |
| 121 EXPECT_TRUE(AxTreeContainsText(ax_tree, "Hello ")); | 121 EXPECT_TRUE(AxTreeContainsText(ax_tree, "Hello ")); |
| 122 EXPECT_TRUE(AxTreeContainsText(ax_tree, "World!")); | 122 EXPECT_TRUE(AxTreeContainsText(ax_tree, "World!")); |
| 123 EXPECT_FALSE(AxTreeContainsText(ax_tree, "foo")); | 123 EXPECT_FALSE(AxTreeContainsText(ax_tree, "foo")); |
| 124 } | 124 } |
| 125 | 125 |
| 126 } // namespace mojo | 126 } // namespace mojo |
| OLD | NEW |