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: 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: Build error 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
« 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 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after
1498 webView->setFocus(false); 1498 webView->setFocus(false);
1499 webView->setFocus(true); 1499 webView->setFocus(true);
1500 1500
1501 WebElement element = webView->mainFrame()->document().getElementById("messag e"); 1501 WebElement element = webView->mainFrame()->document().getElementById("messag e");
1502 // Expect not to see duplication of events. 1502 // Expect not to see duplication of events.
1503 EXPECT_STREQ("blurfocus", element.innerText().utf8().data()); 1503 EXPECT_STREQ("blurfocus", element.innerText().utf8().data());
1504 } 1504 }
1505 1505
1506 TEST_F(WebViewTest, SmartClipData) 1506 TEST_F(WebViewTest, SmartClipData)
1507 { 1507 {
1508 WebString clipData;
1509 WebRect clipRect;
1508 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("Ahem.ttf")); 1510 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("Ahem.ttf"));
1509 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("smartclip.html")); 1511 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("smartclip.html"));
1510 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "smartclip. html"); 1512 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "smartclip. html");
1511 webView->setPageScaleFactorLimits(1, 1); 1513 webView->setPageScaleFactorLimits(1, 1);
1512 webView->resize(WebSize(500, 500)); 1514 webView->resize(WebSize(500, 500));
1513 webView->layout(); 1515 webView->layout();
1514 WebRect cropRect(300, 125, 100, 50); 1516 WebRect cropRect(300, 125, 100, 50);
1515 1517 webView->getSmartClipData(cropRect, clipData, clipRect);
1516 // FIXME: We should test the structure of the data we get back. 1518 EXPECT_FALSE(clipData.isEmpty());
1517 EXPECT_FALSE(webView->getSmartClipData(cropRect).isEmpty());
1518 } 1519 }
1519 1520
1520 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien t { 1521 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien t {
1521 public: 1522 public:
1522 CreateChildCounterFrameClient() : m_count(0) { } 1523 CreateChildCounterFrameClient() : m_count(0) { }
1523 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString& f rameName) OVERRIDE; 1524 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString& f rameName) OVERRIDE;
1524 1525
1525 int count() const { return m_count; } 1526 int count() const { return m_count; }
1526 1527
1527 private: 1528 private:
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1996 1997
1997 EXPECT_EQ(0, client.getUserGestureNotificationsCount()); 1998 EXPECT_EQ(0, client.getUserGestureNotificationsCount());
1998 1999
1999 EXPECT_TRUE(tapElementById(webView, WebInputEvent::GestureTap, WebString::fr omUTF8("target"))); 2000 EXPECT_TRUE(tapElementById(webView, WebInputEvent::GestureTap, WebString::fr omUTF8("target")));
2000 2001
2001 EXPECT_EQ(1, client.getUserGestureNotificationsCount()); 2002 EXPECT_EQ(1, client.getUserGestureNotificationsCount());
2002 webView->setAutofillClient(0); 2003 webView->setAutofillClient(0);
2003 } 2004 }
2004 2005
2005 } // namespace 2006 } // 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