OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/aura/overscroll_navigation_overlay.h" | 5 #include "content/browser/web_contents/aura/overscroll_navigation_overlay.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 // Forces web contents to complete web page load as soon as navigation starts. | 34 // Forces web contents to complete web page load as soon as navigation starts. |
35 class ImmediateLoadObserver : WebContentsObserver { | 35 class ImmediateLoadObserver : WebContentsObserver { |
36 public: | 36 public: |
37 explicit ImmediateLoadObserver(TestWebContents* contents) | 37 explicit ImmediateLoadObserver(TestWebContents* contents) |
38 : contents_(contents) { | 38 : contents_(contents) { |
39 Observe(contents); | 39 Observe(contents); |
40 } | 40 } |
41 ~ImmediateLoadObserver() override {} | 41 ~ImmediateLoadObserver() override {} |
42 | 42 |
43 void DidStartNavigationToPendingEntry( | 43 void DidStartNavigationToPendingEntry(const GURL& url, |
44 const GURL& url, | 44 ReloadType reload_type) override { |
45 NavigationController::ReloadType reload_type) override { | |
46 // Simulate immediate web page load. | 45 // Simulate immediate web page load. |
47 contents_->TestSetIsLoading(false); | 46 contents_->TestSetIsLoading(false); |
48 Observe(nullptr); | 47 Observe(nullptr); |
49 } | 48 } |
50 | 49 |
51 private: | 50 private: |
52 TestWebContents* contents_; | 51 TestWebContents* contents_; |
53 | 52 |
54 DISALLOW_COPY_AND_ASSIGN(ImmediateLoadObserver); | 53 DISALLOW_COPY_AND_ASSIGN(ImmediateLoadObserver); |
55 }; | 54 }; |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 EXPECT_TRUE(GetOverlay()->window_.get()); | 440 EXPECT_TRUE(GetOverlay()->window_.get()); |
442 | 441 |
443 // Load the page. | 442 // Load the page. |
444 contents()->CommitPendingNavigation(); | 443 contents()->CommitPendingNavigation(); |
445 ReceivePaintUpdate(); | 444 ReceivePaintUpdate(); |
446 EXPECT_FALSE(GetOverlay()->window_.get()); | 445 EXPECT_FALSE(GetOverlay()->window_.get()); |
447 EXPECT_EQ(contents()->GetURL(), first()); | 446 EXPECT_EQ(contents()->GetURL(), first()); |
448 } | 447 } |
449 | 448 |
450 } // namespace content | 449 } // namespace content |
OLD | NEW |