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

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: 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..76e4a76c8c22803fa8da0523585f0d8b98c8e3b6 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()) {
+ // The ASSERT is here, because tests below do not do cross-site
+ // navigation.
+ ASSERT(frame->isLocalFrame());
dcheng 2015/11/12 23:47:32 No need for this assert, toLocalFrame() will explo
Łukasz Anforowicz 2015/11/13 00:22:10 Done.
+ serializer.serializeFrame(toLocalFrame(frame));
+ }
}
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