| OLD | NEW |
| 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 "base/strings/utf_string_conversions.h" | 5 #include "base/strings/utf_string_conversions.h" |
| 6 #include "base/values.h" | 6 #include "base/values.h" |
| 7 #include "content/browser/frame_host/navigation_entry_impl.h" | 7 #include "content/browser/frame_host/navigation_entry_impl.h" |
| 8 #include "content/browser/web_contents/web_contents_impl.h" | 8 #include "content/browser/web_contents/web_contents_impl.h" |
| 9 #include "content/public/browser/load_notification_details.h" | 9 #include "content/public/browser/load_notification_details.h" |
| 10 #include "content/public/browser/navigation_controller.h" | 10 #include "content/public/browser/navigation_controller.h" |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 // Observer class to track the creation of RenderFrameHost objects. It is used | 355 // Observer class to track the creation of RenderFrameHost objects. It is used |
| 356 // in subsequent tests. | 356 // in subsequent tests. |
| 357 class RenderFrameCreatedObserver : public WebContentsObserver { | 357 class RenderFrameCreatedObserver : public WebContentsObserver { |
| 358 public: | 358 public: |
| 359 RenderFrameCreatedObserver(Shell* shell) | 359 RenderFrameCreatedObserver(Shell* shell) |
| 360 : WebContentsObserver(shell->web_contents()), | 360 : WebContentsObserver(shell->web_contents()), |
| 361 last_rfh_(NULL) { | 361 last_rfh_(NULL) { |
| 362 } | 362 } |
| 363 | 363 |
| 364 virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) OVERRIDE { | 364 virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) OVERRIDE { |
| 365 LOG(ERROR) << "RFCreated: " << render_frame_host; | |
| 366 last_rfh_ = render_frame_host; | 365 last_rfh_ = render_frame_host; |
| 367 } | 366 } |
| 368 | 367 |
| 369 RenderFrameHost* last_rfh() const { return last_rfh_; } | 368 RenderFrameHost* last_rfh() const { return last_rfh_; } |
| 370 | 369 |
| 371 private: | 370 private: |
| 372 RenderFrameHost* last_rfh_; | 371 RenderFrameHost* last_rfh_; |
| 373 | 372 |
| 374 DISALLOW_COPY_AND_ASSIGN(RenderFrameCreatedObserver); | 373 DISALLOW_COPY_AND_ASSIGN(RenderFrameCreatedObserver); |
| 375 }; | 374 }; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 // LoadingStateChanged should be called 4 times: start and stop for the | 430 // LoadingStateChanged should be called 4 times: start and stop for the |
| 432 // initial load of push_state.html, and start and stop for the "navigation" | 431 // initial load of push_state.html, and start and stop for the "navigation" |
| 433 // triggered by history.pushState(). However, the start notification for the | 432 // triggered by history.pushState(). However, the start notification for the |
| 434 // history.pushState() navigation should set to_different_document to false. | 433 // history.pushState() navigation should set to_different_document to false. |
| 435 EXPECT_EQ("pushState", shell()->web_contents()->GetURL().ref()); | 434 EXPECT_EQ("pushState", shell()->web_contents()->GetURL().ref()); |
| 436 EXPECT_EQ(4, delegate->loadingStateChangedCount()); | 435 EXPECT_EQ(4, delegate->loadingStateChangedCount()); |
| 437 EXPECT_EQ(3, delegate->loadingStateToDifferentDocumentCount()); | 436 EXPECT_EQ(3, delegate->loadingStateToDifferentDocumentCount()); |
| 438 } | 437 } |
| 439 | 438 |
| 440 } // namespace content | 439 } // namespace content |
| 440 |
| OLD | NEW |