Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Side by Side Diff: content/browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc

Issue 2639073002: Convert OverscrollNavigationOverlayTest.ImmediateLoadOnNavigate to use the new navigation callbacks… (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/frame_host/navigator_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // TODO: remove this method when PlzNavigate is turned on by default.
43 void DidStartNavigationToPendingEntry(const GURL& url, 44 void DidStartNavigationToPendingEntry(const GURL& url,
44 ReloadType reload_type) override { 45 ReloadType reload_type) override {
45 // Simulate immediate web page load. 46 if (!IsBrowserSideNavigationEnabled()) {
46 contents_->TestSetIsLoading(false); 47 // Simulate immediate web page load.
47 Observe(nullptr); 48 contents_->TestSetIsLoading(false);
49 Observe(nullptr);
50 }
51 }
52
53 void DidStartNavigation(NavigationHandle* navigation_handlee) override {
54 if (IsBrowserSideNavigationEnabled()) {
55 // Simulate immediate web page load.
56 contents_->TestSetIsLoading(false);
57 Observe(nullptr);
58 }
48 } 59 }
49 60
50 private: 61 private:
51 TestWebContents* contents_; 62 TestWebContents* contents_;
52 63
53 DISALLOW_COPY_AND_ASSIGN(ImmediateLoadObserver); 64 DISALLOW_COPY_AND_ASSIGN(ImmediateLoadObserver);
54 }; 65 };
55 66
56 // A subclass of TestWebContents that offers a fake content window. 67 // A subclass of TestWebContents that offers a fake content window.
57 class OverscrollTestWebContents : public TestWebContents { 68 class OverscrollTestWebContents : public TestWebContents {
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 EXPECT_TRUE(GetOverlay()->window_.get()); 450 EXPECT_TRUE(GetOverlay()->window_.get());
440 451
441 // Load the page. 452 // Load the page.
442 contents()->CommitPendingNavigation(); 453 contents()->CommitPendingNavigation();
443 ReceivePaintUpdate(); 454 ReceivePaintUpdate();
444 EXPECT_FALSE(GetOverlay()->window_.get()); 455 EXPECT_FALSE(GetOverlay()->window_.get());
445 EXPECT_EQ(contents()->GetURL(), first()); 456 EXPECT_EQ(contents()->GetURL(), first());
446 } 457 }
447 458
448 } // namespace content 459 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigator_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698