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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebViewTest.cpp

Issue 1635873003: Replicating WebFrame::uniqueName across renderers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dump-render-tree3
Patch Set: Rebasing... Created 4 years, 10 months 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 2173 matching lines...) Expand 10 before | Expand all | Expand 10 after
2184 webView->updateAllLifecyclePhases(); 2184 webView->updateAllLifecyclePhases();
2185 WebRect cropRect(0, 0, 100, 100); 2185 WebRect cropRect(0, 0, 100, 100);
2186 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect); 2186 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect);
2187 EXPECT_STREQ("", clipText.utf8().c_str()); 2187 EXPECT_STREQ("", clipText.utf8().c_str());
2188 EXPECT_STREQ("", clipHtml.utf8().c_str()); 2188 EXPECT_STREQ("", clipHtml.utf8().c_str());
2189 } 2189 }
2190 2190
2191 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien t { 2191 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien t {
2192 public: 2192 public:
2193 CreateChildCounterFrameClient() : m_count(0) { } 2193 CreateChildCounterFrameClient() : m_count(0) { }
2194 WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const We bString& frameName, WebSandboxFlags, const WebFrameOwnerProperties&) override; 2194 WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const We bString& name, const WebString& uniqueName, WebSandboxFlags, const WebFrameOwner Properties&) override;
2195 2195
2196 int count() const { return m_count; } 2196 int count() const { return m_count; }
2197 2197
2198 private: 2198 private:
2199 int m_count; 2199 int m_count;
2200 }; 2200 };
2201 2201
2202 WebFrame* CreateChildCounterFrameClient::createChildFrame(WebLocalFrame* parent, WebTreeScopeType scope, const WebString& frameName, WebSandboxFlags sandboxFlag s, const WebFrameOwnerProperties& frameOwnerProperties) 2202 WebFrame* CreateChildCounterFrameClient::createChildFrame(WebLocalFrame* parent, WebTreeScopeType scope, const WebString& name, const WebString& uniqueName, Web SandboxFlags sandboxFlags, const WebFrameOwnerProperties& frameOwnerProperties)
2203 { 2203 {
2204 ++m_count; 2204 ++m_count;
2205 return TestWebFrameClient::createChildFrame(parent, scope, frameName, sandbo xFlags, frameOwnerProperties); 2205 return TestWebFrameClient::createChildFrame(parent, scope, name, uniqueName, sandboxFlags, frameOwnerProperties);
2206 } 2206 }
2207 2207
2208 TEST_F(WebViewTest, ChangeDisplayMode) 2208 TEST_F(WebViewTest, ChangeDisplayMode)
2209 { 2209 {
2210 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("display_mode.html")); 2210 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("display_mode.html"));
2211 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "display_mo de.html", true); 2211 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "display_mo de.html", true);
2212 2212
2213 std::string content = WebFrameContentDumper::dumpFrameTreeAsText(webView->ma inFrame()->toWebLocalFrame(), 21).utf8(); 2213 std::string content = WebFrameContentDumper::dumpFrameTreeAsText(webView->ma inFrame()->toWebLocalFrame(), 21).utf8();
2214 EXPECT_EQ("regular-ui", content); 2214 EXPECT_EQ("regular-ui", content);
2215 2215
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
3226 frame->setAutofillClient(&client); 3226 frame->setAutofillClient(&client);
3227 webView->setInitialFocus(false); 3227 webView->setInitialFocus(false);
3228 3228
3229 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel lo").c_str()))); 3229 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel lo").c_str())));
3230 EXPECT_EQ(1, client.textChangesFromUserGesture()); 3230 EXPECT_EQ(1, client.textChangesFromUserGesture());
3231 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); 3231 EXPECT_FALSE(UserGestureIndicator::processingUserGesture());
3232 frame->setAutofillClient(0); 3232 frame->setAutofillClient(0);
3233 } 3233 }
3234 3234
3235 } // namespace blink 3235 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebFrameTest.cpp ('k') | third_party/WebKit/public/web/WebFrameClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698