| 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/public/cpp/web_view.h" | 5 #include "components/web_view/public/cpp/web_view.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> |
| 8 | 9 |
| 9 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
| 10 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 11 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
| 12 #include "base/logging.h" | 13 #include "base/logging.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/path_service.h" | 15 #include "base/path_service.h" |
| 15 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
| 16 #include "components/mus/public/cpp/scoped_window_ptr.h" | 17 #include "components/mus/public/cpp/scoped_window_ptr.h" |
| 17 #include "components/mus/public/cpp/tests/window_server_test_base.h" | 18 #include "components/mus/public/cpp/tests/window_server_test_base.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 77 |
| 77 void StartNestedRunLoopUntil(NestedLoopQuitCondition quit_condition) { | 78 void StartNestedRunLoopUntil(NestedLoopQuitCondition quit_condition) { |
| 78 quit_condition_ = quit_condition; | 79 quit_condition_ = quit_condition; |
| 79 run_loop_.reset(new base::RunLoop); | 80 run_loop_.reset(new base::RunLoop); |
| 80 run_loop_->Run(); | 81 run_loop_->Run(); |
| 81 } | 82 } |
| 82 | 83 |
| 83 void NavigateTo(const std::string& file) { | 84 void NavigateTo(const std::string& file) { |
| 84 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 85 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
| 85 request->url = GetTestFileURL(file).spec(); | 86 request->url = GetTestFileURL(file).spec(); |
| 86 web_view()->LoadRequest(request.Pass()); | 87 web_view()->LoadRequest(std::move(request)); |
| 87 StartNestedRunLoopUntil(LOADING_DONE); | 88 StartNestedRunLoopUntil(LOADING_DONE); |
| 88 } | 89 } |
| 89 | 90 |
| 90 private: | 91 private: |
| 91 void QuitNestedRunLoop() { | 92 void QuitNestedRunLoop() { |
| 92 if (run_loop_) { | 93 if (run_loop_) { |
| 93 quit_condition_ = NO_QUIT; | 94 quit_condition_ = NO_QUIT; |
| 94 run_loop_->Quit(); | 95 run_loop_->Quit(); |
| 95 } | 96 } |
| 96 } | 97 } |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 EXPECT_EQ(i, active_find_match()); | 316 EXPECT_EQ(i, active_find_match()); |
| 316 } | 317 } |
| 317 | 318 |
| 318 // We should wrap around. | 319 // We should wrap around. |
| 319 web_view()->Find("Green", true); | 320 web_view()->Find("Green", true); |
| 320 StartNestedRunLoopUntil(ACTIVE_FIND_UPDATE); | 321 StartNestedRunLoopUntil(ACTIVE_FIND_UPDATE); |
| 321 EXPECT_EQ(1, active_find_match()); | 322 EXPECT_EQ(1, active_find_match()); |
| 322 } | 323 } |
| 323 | 324 |
| 324 } // namespace web_view | 325 } // namespace web_view |
| OLD | NEW |