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

Side by Side Diff: chrome/browser/ui/browser_instant_controller_unittest.cc

Issue 84063003: Rename WebContentsObserver::NavigateToPendingEntry to DidStartNavigationToPendingEntry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding better comment from Charlie. Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <string> 5 #include <string>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/search/instant_service.h" 10 #include "chrome/browser/search/instant_service.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 class FakeWebContentsObserver : public content::WebContentsObserver { 49 class FakeWebContentsObserver : public content::WebContentsObserver {
50 public: 50 public:
51 FakeWebContentsObserver(BrowserInstantControllerTest* base_test, 51 FakeWebContentsObserver(BrowserInstantControllerTest* base_test,
52 content::WebContents* contents) 52 content::WebContents* contents)
53 : WebContentsObserver(contents), 53 : WebContentsObserver(contents),
54 contents_(contents), 54 contents_(contents),
55 base_test_(base_test), 55 base_test_(base_test),
56 url_(contents->GetURL()), 56 url_(contents->GetURL()),
57 num_reloads_(0) {} 57 num_reloads_(0) {}
58 58
59 virtual void NavigateToPendingEntry( 59 virtual void DidStartNavigationToPendingEntry(
60 const GURL& url, 60 const GURL& url,
61 content::NavigationController::ReloadType reload_type) OVERRIDE { 61 content::NavigationController::ReloadType reload_type) OVERRIDE {
62 // The tab reload event doesn't work with BrowserWithTestWindowTest. 62 // The tab reload event doesn't work with BrowserWithTestWindowTest.
63 // So we capture the NavigateToPendingEntry, and use the 63 // So we capture the DidStartNavigationToPendingEntry, and use the
64 // BrowserWithTestWindowTest::NavigateAndCommit to simulate the complete 64 // BrowserWithTestWindowTest::NavigateAndCommit to simulate the complete
65 // reload. Note that this will again trigger NavigateToPendingEntry, so we 65 // reload. Note that this will again trigger
66 // remove this as observer. 66 // DidStartNavigationToPendingEntry, so we remove this as observer.
67 content::NavigationController* controller = 67 content::NavigationController* controller =
68 &web_contents()->GetController(); 68 &web_contents()->GetController();
69 Observe(NULL); 69 Observe(NULL);
70 70
71 if (url_ == url) 71 if (url_ == url)
72 num_reloads_++; 72 num_reloads_++;
73 73
74 base_test_->NavigateAndCommit(controller, url); 74 base_test_->NavigateAndCommit(controller, url);
75 } 75 }
76 76
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 184
185 browser.reset(NULL); 185 browser.reset(NULL);
186 window.reset(NULL); 186 window.reset(NULL);
187 EXPECT_FALSE(IsInstantServiceObserver(bic)) 187 EXPECT_FALSE(IsInstantServiceObserver(bic))
188 << "New BrowserInstantController should register as InstantServiceObserver"; 188 << "New BrowserInstantController should register as InstantServiceObserver";
189 } 189 }
190 190
191 } // namespace 191 } // namespace
192 192
193 } // namespace chrome 193 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_browsertest.cc ('k') | chrome/browser/ui/omnibox/omnibox_navigation_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698