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

Unified Diff: content/public/test/render_view_test.cc

Issue 1425303002: OOPIF: Stop using HistoryController and refactor UpdateState. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nit Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/test/render_view_test.h ('k') | content/renderer/history_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/render_view_test.cc
diff --git a/content/public/test/render_view_test.cc b/content/public/test/render_view_test.cc
index 7810e3a760936c1b8e29503dc368663470627bfd..02ea4b7d912f6a878cb386afba56ba331bda4a3a 100644
--- a/content/public/test/render_view_test.cc
+++ b/content/public/test/render_view_test.cc
@@ -14,6 +14,7 @@
#include "content/common/dom_storage/dom_storage_types.h"
#include "content/common/frame_messages.h"
#include "content/common/input_messages.h"
+#include "content/common/site_isolation_policy.h"
#include "content/common/view_messages.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/native_web_keyboard_event.h"
@@ -180,8 +181,19 @@ void RenderViewTest::LoadHTML(const char* html) {
}
PageState RenderViewTest::GetCurrentPageState() {
- RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
- return HistoryEntryToPageState(impl->history_controller()->GetCurrentEntry());
+ RenderViewImpl* view_impl = static_cast<RenderViewImpl*>(view_);
+
+ if (SiteIsolationPolicy::UseSubframeNavigationEntries()) {
+ // This returns a PageState object for the main frame, excluding subframes.
+ // This could be extended to all local frames if needed by tests, but it
+ // cannot include out-of-process frames.
+ TestRenderFrame* frame =
+ static_cast<TestRenderFrame*>(view_impl->GetMainRenderFrame());
+ return SingleHistoryItemToPageState(frame->current_history_item());
+ } else {
+ return HistoryEntryToPageState(
+ view_impl->history_controller()->GetCurrentEntry());
+ }
}
void RenderViewTest::GoBack(const PageState& state) {
« no previous file with comments | « content/public/test/render_view_test.h ('k') | content/renderer/history_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698