Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <tuple> | 8 #include <tuple> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 | 171 |
| 172 void WaitUntilNavigationStarts() { | 172 void WaitUntilNavigationStarts() { |
| 173 if (navigated_) | 173 if (navigated_) |
| 174 return; | 174 return; |
| 175 should_quit_loop_ = true; | 175 should_quit_loop_ = true; |
| 176 base::RunLoop().Run(); | 176 base::RunLoop().Run(); |
| 177 } | 177 } |
| 178 | 178 |
| 179 private: | 179 private: |
| 180 // Overridden from WebContentsObserver: | 180 // Overridden from WebContentsObserver: |
| 181 void DidStartNavigationToPendingEntry(const GURL& validated_url, | 181 void DidStartNavigation(NavigationHandle* navigation_handle) override { |
|
clamy
2017/01/18 14:33:34
Note: the tests here could maybe use the TestNavig
jam
2017/01/18 16:35:21
Done.
| |
| 182 ReloadType reload_type) override { | |
| 183 navigated_ = true; | 182 navigated_ = true; |
| 184 if (should_quit_loop_) | 183 if (should_quit_loop_) |
| 185 base::MessageLoop::current()->QuitWhenIdle(); | 184 base::MessageLoop::current()->QuitWhenIdle(); |
| 186 } | 185 } |
| 187 | 186 |
| 188 bool navigated_; | 187 bool navigated_; |
| 189 bool should_quit_loop_; | 188 bool should_quit_loop_; |
| 190 | 189 |
| 191 DISALLOW_COPY_AND_ASSIGN(NavigationWatcher); | 190 DISALLOW_COPY_AND_ASSIGN(NavigationWatcher); |
| 192 }; | 191 }; |
| (...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1129 details = dispatcher->OnEventFromSource(&release); | 1128 details = dispatcher->OnEventFromSource(&release); |
| 1130 ASSERT_FALSE(details.dispatcher_destroyed); | 1129 ASSERT_FALSE(details.dispatcher_destroyed); |
| 1131 WaitAFrame(); | 1130 WaitAFrame(); |
| 1132 | 1131 |
| 1133 EXPECT_LT(0, tracker.num_overscroll_updates()); | 1132 EXPECT_LT(0, tracker.num_overscroll_updates()); |
| 1134 EXPECT_FALSE(tracker.overscroll_completed()); | 1133 EXPECT_FALSE(tracker.overscroll_completed()); |
| 1135 } | 1134 } |
| 1136 } | 1135 } |
| 1137 | 1136 |
| 1138 } // namespace content | 1137 } // namespace content |
| OLD | NEW |