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

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

Issue 259263003: Fix to remove customised String over IPC for SmartClip (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: changed according to review comments by eseidel Created 6 years, 6 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 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1479 webView->setFocus(false); 1479 webView->setFocus(false);
1480 webView->setFocus(true); 1480 webView->setFocus(true);
1481 1481
1482 WebElement element = webView->mainFrame()->document().getElementById("messag e"); 1482 WebElement element = webView->mainFrame()->document().getElementById("messag e");
1483 // Expect not to see duplication of events. 1483 // Expect not to see duplication of events.
1484 EXPECT_STREQ("blurfocus", element.innerText().utf8().data()); 1484 EXPECT_STREQ("blurfocus", element.innerText().utf8().data());
1485 } 1485 }
1486 1486
1487 TEST_F(WebViewTest, SmartClipData) 1487 TEST_F(WebViewTest, SmartClipData)
1488 { 1488 {
1489 WebString clipData;
1490 WebRect clipRect;
1489 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("Ahem.ttf")); 1491 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("Ahem.ttf"));
1490 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("smartclip.html")); 1492 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("smartclip.html"));
1491 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "smartclip. html"); 1493 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "smartclip. html");
1492 webView->setPageScaleFactorLimits(1, 1); 1494 webView->setPageScaleFactorLimits(1, 1);
1493 webView->resize(WebSize(500, 500)); 1495 webView->resize(WebSize(500, 500));
1494 webView->layout(); 1496 webView->layout();
1495 WebRect cropRect(300, 125, 100, 50); 1497 WebRect cropRect(300, 125, 100, 50);
1496 1498 webView->getSmartClipData(cropRect, &clipData, &clipRect);
1497 // FIXME: We should test the structure of the data we get back. 1499 EXPECT_FALSE(clipData.isEmpty());}
Inactive 2014/06/09 14:47:10 What's up with this trailing '}'?
AviD 2014/06/13 11:52:48 Done.
1498 EXPECT_FALSE(webView->getSmartClipData(cropRect).isEmpty());
1499 } 1500 }
1500 1501
1501 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien t { 1502 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien t {
1502 public: 1503 public:
1503 CreateChildCounterFrameClient() : m_count(0) { } 1504 CreateChildCounterFrameClient() : m_count(0) { }
1504 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString& f rameName) OVERRIDE; 1505 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString& f rameName) OVERRIDE;
1505 1506
1506 int count() const { return m_count; } 1507 int count() const { return m_count; }
1507 1508
1508 private: 1509 private:
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1977 1978
1978 EXPECT_EQ(0, client.getUserGestureNotificationsCount()); 1979 EXPECT_EQ(0, client.getUserGestureNotificationsCount());
1979 1980
1980 EXPECT_TRUE(tapElementById(webView, WebInputEvent::GestureTap, WebString::fr omUTF8("target"))); 1981 EXPECT_TRUE(tapElementById(webView, WebInputEvent::GestureTap, WebString::fr omUTF8("target")));
1981 1982
1982 EXPECT_EQ(1, client.getUserGestureNotificationsCount()); 1983 EXPECT_EQ(1, client.getUserGestureNotificationsCount());
1983 webView->setAutofillClient(0); 1984 webView->setAutofillClient(0);
1984 } 1985 }
1985 1986
1986 } // namespace 1987 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698