| 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/auto_reset.h" | 5 #include "base/auto_reset.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "base/test/test_timeouts.h" | 12 #include "base/test/test_timeouts.h" |
| 13 #include "base/time/time.h" |
| 13 #include "base/values.h" | 14 #include "base/values.h" |
| 14 #include "components/html_viewer/public/interfaces/test_html_viewer.mojom.h" | 15 #include "components/html_viewer/public/interfaces/test_html_viewer.mojom.h" |
| 15 #include "components/mus/public/cpp/tests/view_manager_test_base.h" | 16 #include "components/mus/public/cpp/tests/view_manager_test_base.h" |
| 16 #include "components/mus/public/cpp/view.h" | 17 #include "components/mus/public/cpp/view.h" |
| 17 #include "components/mus/public/cpp/view_tree_connection.h" | 18 #include "components/mus/public/cpp/view_tree_connection.h" |
| 18 #include "components/web_view/frame.h" | 19 #include "components/web_view/frame.h" |
| 19 #include "components/web_view/frame_connection.h" | 20 #include "components/web_view/frame_connection.h" |
| 20 #include "components/web_view/frame_tree.h" | 21 #include "components/web_view/frame_tree.h" |
| 21 #include "components/web_view/public/interfaces/frame.mojom.h" | 22 #include "components/web_view/public/interfaces/frame.mojom.h" |
| 22 #include "components/web_view/test_frame_tree_delegate.h" | 23 #include "components/web_view/test_frame_tree_delegate.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 base::Bind(&OnGotContentHandlerForRoot, &got_callback)); | 223 base::Bind(&OnGotContentHandlerForRoot, &got_callback)); |
| 223 ignore_result(ViewManagerTestBase::DoRunLoopWithTimeout()); | 224 ignore_result(ViewManagerTestBase::DoRunLoopWithTimeout()); |
| 224 if (!got_callback) | 225 if (!got_callback) |
| 225 return nullptr; | 226 return nullptr; |
| 226 FrameConnection* result = frame_connection.get(); | 227 FrameConnection* result = frame_connection.get(); |
| 227 FrameClient* frame_client = frame_connection->frame_client(); | 228 FrameClient* frame_client = frame_connection->frame_client(); |
| 228 ViewTreeClientPtr tree_client = frame_connection->GetViewTreeClient(); | 229 ViewTreeClientPtr tree_client = frame_connection->GetViewTreeClient(); |
| 229 frame_tree_.reset( | 230 frame_tree_.reset( |
| 230 new FrameTree(result->GetContentHandlerID(), view, tree_client.Pass(), | 231 new FrameTree(result->GetContentHandlerID(), view, tree_client.Pass(), |
| 231 frame_tree_delegate_.get(), frame_client, | 232 frame_tree_delegate_.get(), frame_client, |
| 232 frame_connection.Pass(), Frame::ClientPropertyMap())); | 233 frame_connection.Pass(), Frame::ClientPropertyMap(), |
| 234 base::TimeTicks::Now())); |
| 233 frame_tree_delegate_->set_frame_tree(frame_tree_.get()); | 235 frame_tree_delegate_->set_frame_tree(frame_tree_.get()); |
| 234 return result; | 236 return result; |
| 235 } | 237 } |
| 236 | 238 |
| 237 // ViewManagerTest: | 239 // ViewManagerTest: |
| 238 void SetUp() override { | 240 void SetUp() override { |
| 239 ViewManagerTestBase::SetUp(); | 241 ViewManagerTestBase::SetUp(); |
| 240 | 242 |
| 241 // Start a test server. | 243 // Start a test server. |
| 242 http_server_.reset(new net::SpawnedTestServer( | 244 http_server_.reset(new net::SpawnedTestServer( |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 script_value_as_list->GetString(0u, &message_in_child); | 473 script_value_as_list->GetString(0u, &message_in_child); |
| 472 } | 474 } |
| 473 } | 475 } |
| 474 } while (message_in_child != "hello from parent" && | 476 } while (message_in_child != "hello from parent" && |
| 475 base::TimeTicks::Now() - start_time < | 477 base::TimeTicks::Now() - start_time < |
| 476 TestTimeouts::action_timeout()); | 478 TestTimeouts::action_timeout()); |
| 477 EXPECT_EQ("hello from parent", message_in_child); | 479 EXPECT_EQ("hello from parent", message_in_child); |
| 478 } | 480 } |
| 479 | 481 |
| 480 } // namespace mojo | 482 } // namespace mojo |
| OLD | NEW |