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

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

Issue 222203007: Conversion of more places in Blink to use WebLocalFrame (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/tests/WebPluginContainerTest.cpp ('k') | public/web/WebFrameClient.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 } 1266 }
1267 1267
1268 class ViewCreatingWebViewClient : public WebViewClient { 1268 class ViewCreatingWebViewClient : public WebViewClient {
1269 public: 1269 public:
1270 ViewCreatingWebViewClient() 1270 ViewCreatingWebViewClient()
1271 : m_didFocusCalled(false) 1271 : m_didFocusCalled(false)
1272 { 1272 {
1273 } 1273 }
1274 1274
1275 // WebViewClient methods 1275 // WebViewClient methods
1276 virtual WebView* createView(WebFrame*, const WebURLRequest&, const WebWindow Features&, const WebString& name, WebNavigationPolicy, bool) OVERRIDE 1276 virtual WebView* createView(WebLocalFrame*, const WebURLRequest&, const WebW indowFeatures&, const WebString& name, WebNavigationPolicy, bool) OVERRIDE
1277 { 1277 {
1278 return m_webViewHelper.initialize(true, 0, 0); 1278 return m_webViewHelper.initialize(true, 0, 0);
1279 } 1279 }
1280 1280
1281 // WebWidgetClient methods 1281 // WebWidgetClient methods
1282 virtual void didFocus() OVERRIDE 1282 virtual void didFocus() OVERRIDE
1283 { 1283 {
1284 m_didFocusCalled = true; 1284 m_didFocusCalled = true;
1285 } 1285 }
1286 1286
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1451 webView->layout(); 1451 webView->layout();
1452 WebRect cropRect(300, 125, 100, 50); 1452 WebRect cropRect(300, 125, 100, 50);
1453 1453
1454 // FIXME: We should test the structure of the data we get back. 1454 // FIXME: We should test the structure of the data we get back.
1455 EXPECT_FALSE(webView->getSmartClipData(cropRect).isEmpty()); 1455 EXPECT_FALSE(webView->getSmartClipData(cropRect).isEmpty());
1456 } 1456 }
1457 1457
1458 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien t { 1458 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien t {
1459 public: 1459 public:
1460 CreateChildCounterFrameClient() : m_count(0) { } 1460 CreateChildCounterFrameClient() : m_count(0) { }
1461 virtual WebFrame* createChildFrame(WebFrame* parent, const WebString& frameN ame) OVERRIDE; 1461 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString& f rameName) OVERRIDE;
1462 1462
1463 int count() const { return m_count; } 1463 int count() const { return m_count; }
1464 1464
1465 private: 1465 private:
1466 int m_count; 1466 int m_count;
1467 }; 1467 };
1468 1468
1469 WebFrame* CreateChildCounterFrameClient::createChildFrame(WebFrame* parent, cons t WebString& frameName) 1469 WebFrame* CreateChildCounterFrameClient::createChildFrame(WebLocalFrame* parent, const WebString& frameName)
1470 { 1470 {
1471 ++m_count; 1471 ++m_count;
1472 return TestWebFrameClient::createChildFrame(parent, frameName); 1472 return TestWebFrameClient::createChildFrame(parent, frameName);
1473 } 1473 }
1474 1474
1475 TEST_F(WebViewTest, AddFrameInCloseUnload) 1475 TEST_F(WebViewTest, AddFrameInCloseUnload)
1476 { 1476 {
1477 CreateChildCounterFrameClient frameClient; 1477 CreateChildCounterFrameClient frameClient;
1478 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("add_frame_in_unload.html")); 1478 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("add_frame_in_unload.html"));
1479 m_webViewHelper.initializeAndLoad(m_baseURL + "add_frame_in_unload.html", tr ue, &frameClient); 1479 m_webViewHelper.initializeAndLoad(m_baseURL + "add_frame_in_unload.html", tr ue, &frameClient);
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1735 testSelectionRootBounds("select_range_iframe_textarea_overflow.html", 1.0f); 1735 testSelectionRootBounds("select_range_iframe_textarea_overflow.html", 1.0f);
1736 1736
1737 // Basic page with scale factor. 1737 // Basic page with scale factor.
1738 testSelectionRootBounds("select_range_basic.html", 0.0f); 1738 testSelectionRootBounds("select_range_basic.html", 0.0f);
1739 testSelectionRootBounds("select_range_basic.html", 0.1f); 1739 testSelectionRootBounds("select_range_basic.html", 0.1f);
1740 testSelectionRootBounds("select_range_basic.html", 1.5f); 1740 testSelectionRootBounds("select_range_basic.html", 1.5f);
1741 testSelectionRootBounds("select_range_basic.html", 2.0f); 1741 testSelectionRootBounds("select_range_basic.html", 2.0f);
1742 } 1742 }
1743 1743
1744 } // namespace 1744 } // namespace
OLDNEW
« no previous file with comments | « Source/web/tests/WebPluginContainerTest.cpp ('k') | public/web/WebFrameClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698