OLD | NEW |
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 #include "public/web/WebViewClient.h" | 89 #include "public/web/WebViewClient.h" |
90 #include "public/web/WebWidget.h" | 90 #include "public/web/WebWidget.h" |
91 #include "public/web/WebWidgetClient.h" | 91 #include "public/web/WebWidgetClient.h" |
92 #include "testing/gtest/include/gtest/gtest.h" | 92 #include "testing/gtest/include/gtest/gtest.h" |
93 #include "third_party/skia/include/core/SkBitmap.h" | 93 #include "third_party/skia/include/core/SkBitmap.h" |
94 #include "third_party/skia/include/core/SkCanvas.h" | 94 #include "third_party/skia/include/core/SkCanvas.h" |
95 #include "web/WebLocalFrameImpl.h" | 95 #include "web/WebLocalFrameImpl.h" |
96 #include "web/WebSettingsImpl.h" | 96 #include "web/WebSettingsImpl.h" |
97 #include "web/WebViewImpl.h" | 97 #include "web/WebViewImpl.h" |
98 #include "web/tests/FrameTestHelpers.h" | 98 #include "web/tests/FrameTestHelpers.h" |
99 #include "wtf/PtrUtil.h" | |
100 #include <memory> | |
101 | 99 |
102 #if OS(MACOSX) | 100 #if OS(MACOSX) |
103 #include "public/web/mac/WebSubstringUtil.h" | 101 #include "public/web/mac/WebSubstringUtil.h" |
104 #endif | 102 #endif |
105 | 103 |
106 using blink::FrameTestHelpers::loadFrame; | 104 using blink::FrameTestHelpers::loadFrame; |
107 using blink::URLTestHelpers::toKURL; | 105 using blink::URLTestHelpers::toKURL; |
108 using blink::URLTestHelpers::registerMockedURLLoad; | 106 using blink::URLTestHelpers::registerMockedURLLoad; |
109 using blink::testing::runPendingTasks; | 107 using blink::testing::runPendingTasks; |
110 | 108 |
(...skipping 1748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1859 } | 1857 } |
1860 | 1858 |
1861 static void configueCompositingWebView(WebSettings* settings) | 1859 static void configueCompositingWebView(WebSettings* settings) |
1862 { | 1860 { |
1863 settings->setAcceleratedCompositingEnabled(true); | 1861 settings->setAcceleratedCompositingEnabled(true); |
1864 settings->setPreferCompositingToLCDTextEnabled(true); | 1862 settings->setPreferCompositingToLCDTextEnabled(true); |
1865 } | 1863 } |
1866 | 1864 |
1867 TEST_F(WebViewTest, ShowPressOnTransformedLink) | 1865 TEST_F(WebViewTest, ShowPressOnTransformedLink) |
1868 { | 1866 { |
1869 std::unique_ptr<FrameTestHelpers::TestWebViewClient> fakeCompositingWebViewC
lient = wrapUnique(new FrameTestHelpers::TestWebViewClient()); | 1867 OwnPtr<FrameTestHelpers::TestWebViewClient> fakeCompositingWebViewClient = a
doptPtr(new FrameTestHelpers::TestWebViewClient()); |
1870 FrameTestHelpers::WebViewHelper webViewHelper; | 1868 FrameTestHelpers::WebViewHelper webViewHelper; |
1871 WebViewImpl* webViewImpl = webViewHelper.initialize(true, nullptr, fakeCompo
sitingWebViewClient.get(), nullptr, &configueCompositingWebView); | 1869 WebViewImpl* webViewImpl = webViewHelper.initialize(true, nullptr, fakeCompo
sitingWebViewClient.get(), nullptr, &configueCompositingWebView); |
1872 | 1870 |
1873 int pageWidth = 640; | 1871 int pageWidth = 640; |
1874 int pageHeight = 480; | 1872 int pageHeight = 480; |
1875 webViewImpl->resize(WebSize(pageWidth, pageHeight)); | 1873 webViewImpl->resize(WebSize(pageWidth, pageHeight)); |
1876 | 1874 |
1877 WebURL baseURL = URLTestHelpers::toKURL("http://example.com/"); | 1875 WebURL baseURL = URLTestHelpers::toKURL("http://example.com/"); |
1878 FrameTestHelpers::loadHTMLString(webViewImpl->mainFrame(), "<a href='http://
www.test.com' style='position: absolute; left: 20px; top: 20px; width: 200px; tr
ansform:translateZ(0);'>A link to highlight</a>", baseURL); | 1876 FrameTestHelpers::loadHTMLString(webViewImpl->mainFrame(), "<a href='http://
www.test.com' style='position: absolute; left: 20px; top: 20px; width: 200px; tr
ansform:translateZ(0);'>A link to highlight</a>", baseURL); |
1879 | 1877 |
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3179 frame->setAutofillClient(&client); | 3177 frame->setAutofillClient(&client); |
3180 webView->setInitialFocus(false); | 3178 webView->setInitialFocus(false); |
3181 | 3179 |
3182 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); | 3180 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); |
3183 EXPECT_EQ(1, client.textChangesFromUserGesture()); | 3181 EXPECT_EQ(1, client.textChangesFromUserGesture()); |
3184 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); | 3182 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); |
3185 frame->setAutofillClient(0); | 3183 frame->setAutofillClient(0); |
3186 } | 3184 } |
3187 | 3185 |
3188 } // namespace blink | 3186 } // namespace blink |
OLD | NEW |