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

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

Issue 190723007: Fix tests to be compatible with Android scale initialization. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reupload Created 6 years, 9 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
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 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after
1440 WebElement element = webView->mainFrame()->document().getElementById("messag e"); 1440 WebElement element = webView->mainFrame()->document().getElementById("messag e");
1441 // Expect not to see duplication of events. 1441 // Expect not to see duplication of events.
1442 EXPECT_STREQ("blurfocus", element.innerText().utf8().data()); 1442 EXPECT_STREQ("blurfocus", element.innerText().utf8().data());
1443 } 1443 }
1444 1444
1445 TEST_F(WebViewTest, SmartClipData) 1445 TEST_F(WebViewTest, SmartClipData)
1446 { 1446 {
1447 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("Ahem.ttf")); 1447 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("Ahem.ttf"));
1448 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("smartclip.html")); 1448 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("smartclip.html"));
1449 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "smartclip. html"); 1449 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "smartclip. html");
1450 webView->setPageScaleFactorLimits(1, 1);
1450 webView->resize(WebSize(500, 500)); 1451 webView->resize(WebSize(500, 500));
1451 webView->layout(); 1452 webView->layout();
1452 WebRect cropRect(300, 125, 100, 50); 1453 WebRect cropRect(300, 125, 100, 50);
1453 1454
1454 // FIXME: We should test the structure of the data we get back. 1455 // FIXME: We should test the structure of the data we get back.
1455 EXPECT_FALSE(webView->getSmartClipData(cropRect).isEmpty()); 1456 EXPECT_FALSE(webView->getSmartClipData(cropRect).isEmpty());
1456 } 1457 }
1457 1458
1458 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien t { 1459 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien t {
1459 public: 1460 public:
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1647 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(false)); 1648 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(false));
1648 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(true)); 1649 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(true));
1649 1650
1650 // Now removing the handler in the parent document results in a no-handlers call. 1651 // Now removing the handler in the parent document results in a no-handlers call.
1651 document->didRemoveTouchEventHandler(childFrame); 1652 document->didRemoveTouchEventHandler(childFrame);
1652 EXPECT_EQ(1, client.getAndResetHasTouchEventHandlerCallCount(false)); 1653 EXPECT_EQ(1, client.getAndResetHasTouchEventHandlerCallCount(false));
1653 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(true)); 1654 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(true));
1654 } 1655 }
1655 1656
1656 } // namespace 1657 } // namespace
OLDNEW
« Source/web/tests/WebFrameTest.cpp ('K') | « Source/web/tests/WebFrameTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698