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

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

Issue 2227563003: Refactoring button field and its type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix new instances Created 4 years, 4 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 1835 matching lines...) Expand 10 before | Expand all | Expand 10 after
1846 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("form.html")); 1846 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("form.html"));
1847 WebViewImpl* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "form.h tml", true); 1847 WebViewImpl* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "form.h tml", true);
1848 1848
1849 webView->setInitialFocus(false); 1849 webView->setInitialFocus(false);
1850 runPendingTasks(); 1850 runPendingTasks();
1851 1851
1852 // We suspend caret blinking when pressing with mouse right button. 1852 // We suspend caret blinking when pressing with mouse right button.
1853 // Note that we do not send MouseUp event here since it will be consumed 1853 // Note that we do not send MouseUp event here since it will be consumed
1854 // by the context menu once it shows up. 1854 // by the context menu once it shows up.
1855 WebMouseEvent mouseEvent; 1855 WebMouseEvent mouseEvent;
1856 mouseEvent.button = WebMouseEvent::ButtonRight; 1856 mouseEvent.button = WebMouseEvent::Button::Right;
1857 mouseEvent.x = 1; 1857 mouseEvent.x = 1;
1858 mouseEvent.y = 1; 1858 mouseEvent.y = 1;
1859 mouseEvent.clickCount = 1; 1859 mouseEvent.clickCount = 1;
1860 mouseEvent.type = WebInputEvent::MouseDown; 1860 mouseEvent.type = WebInputEvent::MouseDown;
1861 webView->handleInputEvent(mouseEvent); 1861 webView->handleInputEvent(mouseEvent);
1862 runPendingTasks(); 1862 runPendingTasks();
1863 1863
1864 WebLocalFrameImpl* mainFrame = webView->mainFrameImpl(); 1864 WebLocalFrameImpl* mainFrame = webView->mainFrameImpl();
1865 EXPECT_TRUE(mainFrame->frame()->selection().isCaretBlinkingSuspended()); 1865 EXPECT_TRUE(mainFrame->frame()->selection().isCaretBlinkingSuspended());
1866 1866
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after
2848 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("form.html")); 2848 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("form.html"));
2849 MockAutofillClient client; 2849 MockAutofillClient client;
2850 WebViewImpl* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "form.h tml", true); 2850 WebViewImpl* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "form.h tml", true);
2851 WebLocalFrameImpl* frame = webView->mainFrameImpl(); 2851 WebLocalFrameImpl* frame = webView->mainFrameImpl();
2852 frame->setAutofillClient(&client); 2852 frame->setAutofillClient(&client);
2853 webView->setInitialFocus(false); 2853 webView->setInitialFocus(false);
2854 2854
2855 EXPECT_EQ(0, client.getUserGestureNotificationsCount()); 2855 EXPECT_EQ(0, client.getUserGestureNotificationsCount());
2856 2856
2857 WebMouseEvent mouseEvent; 2857 WebMouseEvent mouseEvent;
2858 mouseEvent.button = WebMouseEvent::ButtonLeft; 2858 mouseEvent.button = WebMouseEvent::Button::Left;
2859 mouseEvent.x = 1; 2859 mouseEvent.x = 1;
2860 mouseEvent.y = 1; 2860 mouseEvent.y = 1;
2861 mouseEvent.clickCount = 1; 2861 mouseEvent.clickCount = 1;
2862 mouseEvent.type = WebInputEvent::MouseDown; 2862 mouseEvent.type = WebInputEvent::MouseDown;
2863 webView->handleInputEvent(mouseEvent); 2863 webView->handleInputEvent(mouseEvent);
2864 mouseEvent.type = WebInputEvent::MouseUp; 2864 mouseEvent.type = WebInputEvent::MouseUp;
2865 webView->handleInputEvent(mouseEvent); 2865 webView->handleInputEvent(mouseEvent);
2866 2866
2867 EXPECT_EQ(1, client.getUserGestureNotificationsCount()); 2867 EXPECT_EQ(1, client.getUserGestureNotificationsCount());
2868 frame->setAutofillClient(0); 2868 frame->setAutofillClient(0);
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
3280 EXPECT_TRUE(webView->page()->defersLoading()); 3280 EXPECT_TRUE(webView->page()->defersLoading());
3281 } 3281 }
3282 3282
3283 EXPECT_TRUE(webView->page()->defersLoading()); 3283 EXPECT_TRUE(webView->page()->defersLoading());
3284 } 3284 }
3285 3285
3286 EXPECT_FALSE(webView->page()->defersLoading()); 3286 EXPECT_FALSE(webView->page()->defersLoading());
3287 } 3287 }
3288 3288
3289 } // namespace blink 3289 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698