mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium revision 2b3ae3b8 (#394939)
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
// can be found in the LICENSE file.
|
||||
|
||||
#include "include/base/cef_bind.h"
|
||||
#include "include/base/cef_scoped_ptr.h"
|
||||
#include "include/wrapper/cef_closure_task.h"
|
||||
#include "include/wrapper/cef_stream_resource_handler.h"
|
||||
#include "tests/cefclient/browser/client_app_browser.h"
|
||||
|
@@ -118,10 +118,6 @@ const unsigned int kNativeKeyTestCodes[] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
// width for the icon that appear on the screen when pressing
|
||||
// middle mouse button
|
||||
const int kMiddleButtonIconWidth = 16;
|
||||
|
||||
// test type
|
||||
enum OSRTestType {
|
||||
// IsWindowRenderingDisabled should be true
|
||||
@@ -142,8 +138,6 @@ enum OSRTestType {
|
||||
OSR_TEST_SCREEN_POINT,
|
||||
// left click in text box should query repainting edit box area
|
||||
OSR_TEST_CLICK_LEFT,
|
||||
// clicking middle mouse button, will draw the scroll icon
|
||||
OSR_TEST_CLICK_MIDDLE,
|
||||
// Resize should trigger a full repaint with the new given size
|
||||
OSR_TEST_RESIZE,
|
||||
// Invalidate should trigger repaint synchronously
|
||||
@@ -257,10 +251,6 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
EXPECT_STREQ(messageStr.c_str(), "osrclick0");
|
||||
DestroySucceededTestSoon();
|
||||
break;
|
||||
case OSR_TEST_CLICK_MIDDLE:
|
||||
EXPECT_STREQ(messageStr.c_str(), "osrclick1");
|
||||
DestroySucceededTestSoon();
|
||||
break;
|
||||
case OSR_TEST_MOUSE_MOVE:
|
||||
EXPECT_STREQ(messageStr.c_str(), "osrmousemove");
|
||||
DestroySucceededTestSoon();
|
||||
@@ -507,29 +497,6 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
mouse_event, MBT_LEFT, true, 1);
|
||||
}
|
||||
break;
|
||||
case OSR_TEST_CLICK_MIDDLE:
|
||||
if (StartTest()) {
|
||||
CefMouseEvent mouse_event;
|
||||
const CefRect& expected_rect = GetExpectedRect(0);
|
||||
mouse_event.x = MiddleX(expected_rect);
|
||||
mouse_event.y = MiddleY(expected_rect);
|
||||
mouse_event.modifiers = 0;
|
||||
browser->GetHost()->SendMouseClickEvent(
|
||||
mouse_event, MBT_MIDDLE, false, 1);
|
||||
browser->GetHost()->SendMouseClickEvent(
|
||||
mouse_event, MBT_MIDDLE, true, 1);
|
||||
} else {
|
||||
EXPECT_EQ(dirtyRects.size(), 1U);
|
||||
const CefRect& expected_rect = GetExpectedRect(0);
|
||||
CefRect button_icon_rect(
|
||||
MiddleX(expected_rect) - kMiddleButtonIconWidth / 2,
|
||||
MiddleY(expected_rect) - kMiddleButtonIconWidth / 2,
|
||||
kMiddleButtonIconWidth, kMiddleButtonIconWidth);
|
||||
button_icon_rect = GetScaledRect(button_icon_rect);
|
||||
EXPECT_EQ(dirtyRects[0], button_icon_rect);
|
||||
DestroySucceededTestSoon();
|
||||
}
|
||||
break;
|
||||
case OSR_TEST_RESIZE:
|
||||
if (StartTest()) {
|
||||
browser->GetHost()->WasResized();
|
||||
@@ -1078,11 +1045,6 @@ OSR_TEST(MouseRightClick, OSR_TEST_CLICK_RIGHT, 1.0f);
|
||||
OSR_TEST(MouseRightClick2x, OSR_TEST_CLICK_RIGHT, 2.0f);
|
||||
OSR_TEST(MouseLeftClick, OSR_TEST_CLICK_LEFT, 1.0f);
|
||||
OSR_TEST(MouseLeftClick2x, OSR_TEST_CLICK_LEFT, 2.0f);
|
||||
#if !defined(OS_WIN)
|
||||
// The middle mouse click scroll icon is not currently shown on Windows.
|
||||
OSR_TEST(MouseMiddleClick, OSR_TEST_CLICK_MIDDLE, 1.0f);
|
||||
OSR_TEST(MouseMiddleClick2x, OSR_TEST_CLICK_MIDDLE, 2.0f);
|
||||
#endif
|
||||
OSR_TEST(ScreenPoint, OSR_TEST_SCREEN_POINT, 1.0f);
|
||||
OSR_TEST(ScreenPoint2x, OSR_TEST_SCREEN_POINT, 2.0f);
|
||||
OSR_TEST(Resize, OSR_TEST_RESIZE, 1.0f);
|
||||
|
@@ -22,6 +22,17 @@ const int kStateDelayMS = 200;
|
||||
|
||||
const int kWSize = TestWindowDelegate::kWSize;
|
||||
|
||||
// Test that |expected| and |actual| are within |allowed_deviance| of each
|
||||
// other.
|
||||
void ExpectCloseRects(const CefRect& expected,
|
||||
const CefRect& actual,
|
||||
int allowed_deviance) {
|
||||
EXPECT_LE(abs(expected.x - actual.x), allowed_deviance);
|
||||
EXPECT_LE(abs(expected.y - actual.y), allowed_deviance);
|
||||
EXPECT_LE(abs(expected.width - actual.width), allowed_deviance);
|
||||
EXPECT_LE(abs(expected.height - actual.height), allowed_deviance);
|
||||
}
|
||||
|
||||
void WindowCreateImpl(base::WaitableEvent* event) {
|
||||
TestWindowDelegate::RunTest(event, TestWindowDelegate::WindowTest(), false);
|
||||
}
|
||||
@@ -87,10 +98,10 @@ void CreateBoxLayout(CefRefPtr<CefWindow> parent) {
|
||||
parent->Layout();
|
||||
|
||||
// The children should each take up 50% of the client area.
|
||||
EXPECT_EQ(CefRect(0, 0, kWSize, kWSize / 2),
|
||||
panel_child1->GetBounds());
|
||||
EXPECT_EQ(CefRect(0, kWSize / 2, kWSize, kWSize / 2),
|
||||
panel_child2->GetBounds());
|
||||
ExpectCloseRects(CefRect(0, 0, kWSize, kWSize / 2),
|
||||
panel_child1->GetBounds(), 1);
|
||||
ExpectCloseRects(CefRect(0, kWSize / 2, kWSize, kWSize / 2),
|
||||
panel_child2->GetBounds(), 1);
|
||||
}
|
||||
|
||||
void RunWindowLayoutAndCoords(CefRefPtr<CefWindow> window) {
|
||||
|
Reference in New Issue
Block a user