| 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 "components/web_view/frame.h" | 5 #include "components/web_view/frame.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 void set_window(Window* window) { window_ = window; } | 244 void set_window(Window* window) { window_ = window; } |
| 245 | 245 |
| 246 // Runs a message loop until the window and frame data have been received. | 246 // Runs a message loop until the window and frame data have been received. |
| 247 void WaitForViewAndFrame() { run_loop_.Run(); } | 247 void WaitForViewAndFrame() { run_loop_.Run(); } |
| 248 | 248 |
| 249 mojo::InterfaceRequest<mojom::Frame> GetServerFrameRequest() { | 249 mojo::InterfaceRequest<mojom::Frame> GetServerFrameRequest() { |
| 250 return test_frame_tree_client_.GetServerFrameRequest(); | 250 return test_frame_tree_client_.GetServerFrameRequest(); |
| 251 } | 251 } |
| 252 | 252 |
| 253 mojom::FrameClientPtr GetFrameClientPtr() { | 253 mojom::FrameClientPtr GetFrameClientPtr() { |
| 254 mojom::FrameClientPtr client_ptr; | 254 return frame_client_binding_.CreateInterfacePtrAndBind(); |
| 255 frame_client_binding_.Bind(GetProxy(&client_ptr)); | |
| 256 return client_ptr; | |
| 257 } | 255 } |
| 258 | 256 |
| 259 void Bind(mojo::InterfaceRequest<mojom::FrameClient> request) { | 257 void Bind(mojo::InterfaceRequest<mojom::FrameClient> request) { |
| 260 ASSERT_FALSE(frame_client_binding_.is_bound()); | 258 ASSERT_FALSE(frame_client_binding_.is_bound()); |
| 261 test_frame_tree_client_.set_on_connect_callback( | 259 test_frame_tree_client_.set_on_connect_callback( |
| 262 base::Bind(&WindowAndFrame::OnGotConnect, base::Unretained(this))); | 260 base::Bind(&WindowAndFrame::OnGotConnect, base::Unretained(this))); |
| 263 frame_client_binding_.Bind(std::move(request)); | 261 frame_client_binding_.Bind(std::move(request)); |
| 264 } | 262 } |
| 265 | 263 |
| 266 void OnGotConnect() { QuitRunLoopIfNecessary(); } | 264 void OnGotConnect() { QuitRunLoopIfNecessary(); } |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 base::TimeTicks navigation_start_time = base::TimeTicks::FromInternalValue(1); | 576 base::TimeTicks navigation_start_time = base::TimeTicks::FromInternalValue(1); |
| 579 scoped_ptr<WindowAndFrame> navigated_child_view_and_frame = | 577 scoped_ptr<WindowAndFrame> navigated_child_view_and_frame = |
| 580 NavigateFrameWithStartTime(child_view_and_frame.get(), | 578 NavigateFrameWithStartTime(child_view_and_frame.get(), |
| 581 navigation_start_time); | 579 navigation_start_time); |
| 582 EXPECT_EQ(navigation_start_time, | 580 EXPECT_EQ(navigation_start_time, |
| 583 navigated_child_view_and_frame->test_frame_client() | 581 navigated_child_view_and_frame->test_frame_client() |
| 584 ->last_navigation_start_time()); | 582 ->last_navigation_start_time()); |
| 585 } | 583 } |
| 586 | 584 |
| 587 } // namespace web_view | 585 } // namespace web_view |
| OLD | NEW |