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 "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 Loading... |
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 Loading... |
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 |
OLD | NEW |