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

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 2nd round of 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..41712bc56c4533ab0999cd1981dcfa1bc206388b 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,12 @@ 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).
+ serializer.serializeFrame(*toLocalFrame(frame));
+ }
}
Vector<SerializedResource>& getResources()
@@ -131,7 +137,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