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

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

Issue 266193003: Revert of Fix to remove customised String over IPC for SmartClip (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | public/web/WebView.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 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after
1429 webView->setFocus(false); 1429 webView->setFocus(false);
1430 webView->setFocus(true); 1430 webView->setFocus(true);
1431 1431
1432 WebElement element = webView->mainFrame()->document().getElementById("messag e"); 1432 WebElement element = webView->mainFrame()->document().getElementById("messag e");
1433 // Expect not to see duplication of events. 1433 // Expect not to see duplication of events.
1434 EXPECT_STREQ("blurfocus", element.innerText().utf8().data()); 1434 EXPECT_STREQ("blurfocus", element.innerText().utf8().data());
1435 } 1435 }
1436 1436
1437 TEST_F(WebViewTest, SmartClipData) 1437 TEST_F(WebViewTest, SmartClipData)
1438 { 1438 {
1439 WebString clipData;
1440 WebRect clipRect;
1441 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("Ahem.ttf")); 1439 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("Ahem.ttf"));
1442 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("smartclip.html")); 1440 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("smartclip.html"));
1443 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "smartclip. html"); 1441 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "smartclip. html");
1444 webView->resize(WebSize(500, 500)); 1442 webView->resize(WebSize(500, 500));
1445 webView->layout(); 1443 webView->layout();
1446 WebRect cropRect(300, 125, 100, 50); 1444 WebRect cropRect(300, 125, 100, 50);
1447 webView->getSmartClipData(cropRect, &clipData, &clipRect);
1448 1445
1449 EXPECT_FALSE(clipData.isEmpty()); 1446 // FIXME: We should test the structure of the data we get back.
1447 EXPECT_FALSE(webView->getSmartClipData(cropRect).isEmpty());
1450 } 1448 }
1451 1449
1452 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien t { 1450 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien t {
1453 public: 1451 public:
1454 CreateChildCounterFrameClient() : m_count(0) { } 1452 CreateChildCounterFrameClient() : m_count(0) { }
1455 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString& f rameName) OVERRIDE; 1453 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString& f rameName) OVERRIDE;
1456 1454
1457 int count() const { return m_count; } 1455 int count() const { return m_count; }
1458 1456
1459 private: 1457 private:
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1928 1926
1929 EXPECT_EQ(0, client.getUserGestureNotificationsCount()); 1927 EXPECT_EQ(0, client.getUserGestureNotificationsCount());
1930 1928
1931 EXPECT_TRUE(tapElementById(webView, WebInputEvent::GestureTap, WebString::fr omUTF8("target"))); 1929 EXPECT_TRUE(tapElementById(webView, WebInputEvent::GestureTap, WebString::fr omUTF8("target")));
1932 1930
1933 EXPECT_EQ(1, client.getUserGestureNotificationsCount()); 1931 EXPECT_EQ(1, client.getUserGestureNotificationsCount());
1934 webView->setAutofillClient(0); 1932 webView->setAutofillClient(0);
1935 } 1933 }
1936 1934
1937 } // namespace 1935 } // namespace
OLDNEW
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | public/web/WebView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698