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

Unified Diff: third_party/WebKit/Source/web/tests/PageSerializerTest.cpp

Issue 1436683002: Making PageSerializer operate on single frames only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mhtml-removing-unused-code
Patch Set: Addressed CR feedback from Daniel. 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
Index: third_party/WebKit/Source/web/tests/PageSerializerTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/PageSerializerTest.cpp b/third_party/WebKit/Source/web/tests/PageSerializerTest.cpp
index 6cbf3fdc036e473793546b9d18599a1bafebf62c..f94ae4054b8130026805fb1b3b9d1942afc9e149 100644
--- a/third_party/WebKit/Source/web/tests/PageSerializerTest.cpp
+++ b/third_party/WebKit/Source/web/tests/PageSerializerTest.cpp
@@ -47,6 +47,7 @@
#include "web/WebLocalFrameImpl.h"
#include "web/WebViewImpl.h"
#include "web/tests/FrameTestHelpers.h"
+#include "wtf/Assertions.h"
#include "wtf/Vector.h"
#include <gtest/gtest.h>
@@ -123,7 +124,13 @@ protected:
for (const auto& rewriteURL: m_rewriteURLs)
serializer.registerRewriteURL(rewriteURL.key, rewriteURL.value);
- serializer.serialize(m_helper.webViewImpl()->mainFrameImpl()->frame()->page());
+ Frame* frame = m_helper.webViewImpl()->mainFrameImpl()->frame();
+ for (; frame; frame = frame->tree().traverseNext()) {
+ // This is safe, because tests do not do cross-site navigation
+ // (and therefore don't have remote frames).
+ LocalFrame* localFrame = toLocalFrame(frame);
+ serializer.serializeFrame(*localFrame);
dcheng 2015/11/18 03:27:12 Nit: just inline toLocalFrame(*frame) here.
Łukasz Anforowicz 2015/11/18 18:40:41 Done.
+ }
}
Vector<SerializedResource>& getResources()
@@ -131,7 +138,6 @@ protected:
return m_resources;
}
-
const SerializedResource* getResource(const char* url, const char* mimeType)
{
KURL kURL = KURL(m_baseUrl, url);

Powered by Google App Engine
This is Rietveld 408576698