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

Side by Side Diff: content/browser/web_contents/web_contents_impl_unittest.cc

Issue 373623002: Convert remaining WebContentsObservers loading callbacks to use RFH. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix one more compile error Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
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 "base/logging.h" 5 #include "base/logging.h"
6 #include "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "content/browser/frame_host/cross_site_transferring_request.h" 7 #include "content/browser/frame_host/cross_site_transferring_request.h"
8 #include "content/browser/frame_host/interstitial_page_impl.h" 8 #include "content/browser/frame_host/interstitial_page_impl.h"
9 #include "content/browser/frame_host/navigation_entry_impl.h" 9 #include "content/browser/frame_host/navigation_entry_impl.h"
10 #include "content/browser/renderer_host/render_view_host_impl.h" 10 #include "content/browser/renderer_host/render_view_host_impl.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 WebContentsImplTestWebUIControllerFactory factory_; 265 WebContentsImplTestWebUIControllerFactory factory_;
266 }; 266 };
267 267
268 class TestWebContentsObserver : public WebContentsObserver { 268 class TestWebContentsObserver : public WebContentsObserver {
269 public: 269 public:
270 explicit TestWebContentsObserver(WebContents* contents) 270 explicit TestWebContentsObserver(WebContents* contents)
271 : WebContentsObserver(contents) { 271 : WebContentsObserver(contents) {
272 } 272 }
273 virtual ~TestWebContentsObserver() {} 273 virtual ~TestWebContentsObserver() {}
274 274
275 virtual void DidFinishLoad(int64 frame_id, 275 virtual void DidFinishLoad(RenderFrameHost* render_frame_host,
276 const GURL& validated_url, 276 const GURL& validated_url) OVERRIDE {
277 bool is_main_frame,
278 RenderViewHost* render_view_host) OVERRIDE {
279 last_url_ = validated_url; 277 last_url_ = validated_url;
280 } 278 }
281 virtual void DidFailLoad(int64 frame_id, 279 virtual void DidFailLoad(RenderFrameHost* render_frame_host,
282 const GURL& validated_url, 280 const GURL& validated_url,
283 bool is_main_frame,
284 int error_code, 281 int error_code,
285 const base::string16& error_description, 282 const base::string16& error_description) OVERRIDE {
286 RenderViewHost* render_view_host) OVERRIDE {
287 last_url_ = validated_url; 283 last_url_ = validated_url;
288 } 284 }
289 285
290 const GURL& last_url() const { return last_url_; } 286 const GURL& last_url() const { return last_url_; }
291 287
292 private: 288 private:
293 GURL last_url_; 289 GURL last_url_;
294 290
295 DISALLOW_COPY_AND_ASSIGN(TestWebContentsObserver); 291 DISALLOW_COPY_AND_ASSIGN(TestWebContentsObserver);
296 }; 292 };
(...skipping 2414 matching lines...) Expand 10 before | Expand all | Expand 10 after
2711 contents->CommitPendingNavigation(); 2707 contents->CommitPendingNavigation();
2712 EXPECT_EQ(0u, instance->GetRelatedActiveContentsCount()); 2708 EXPECT_EQ(0u, instance->GetRelatedActiveContentsCount());
2713 EXPECT_EQ(1u, instance_webui->GetRelatedActiveContentsCount()); 2709 EXPECT_EQ(1u, instance_webui->GetRelatedActiveContentsCount());
2714 2710
2715 contents.reset(); 2711 contents.reset();
2716 EXPECT_EQ(0u, instance->GetRelatedActiveContentsCount()); 2712 EXPECT_EQ(0u, instance->GetRelatedActiveContentsCount());
2717 EXPECT_EQ(0u, instance_webui->GetRelatedActiveContentsCount()); 2713 EXPECT_EQ(0u, instance_webui->GetRelatedActiveContentsCount());
2718 } 2714 }
2719 2715
2720 } // namespace content 2716 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/public/browser/web_contents_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698