Commit 356f9005 authored by battre@chromium.org's avatar battre@chromium.org

Revert 273770 "Enable touch text selection tests on all Aura pla..."

Fails TouchEditableImplAuraTest.TouchCursorInTextfieldTest on Win7. See
http://crbug.com/377561#c4 for details.

> Enable touch text selection tests on all Aura platforms
> 
> In order to make touch text selection ready for Windows and other Aura
> platforms, a prerequisite is to enable tests. Following tests are
> enabled:
>  - TouchSelectionControllerImplTest in views_unittests;
>  - TouchEditableImplAuraTest in content_browsertests.
> 
> BUG=377561
> 
> Review URL: https://codereview.chromium.org/304883002

TBR=mohsen@chromium.org

Review URL: https://codereview.chromium.org/304253007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273805 0039d316-1c4b-4281-b951-d872f2087c98
parent 7fce400a
......@@ -255,31 +255,20 @@ void TouchEditableImplAura::ConvertPointToScreen(gfx::Point* point) {
if (!rwhva_)
return;
aura::Window* window = rwhva_->GetNativeView();
aura::Window* root = window->GetRootWindow();
// First convert the point to root window coordinates, then if there is a
// screen position client, convert it to screen coordinates.
aura::Window::ConvertPointToTarget(window, root, point);
aura::client::ScreenPositionClient* screen_position_client =
aura::client::GetScreenPositionClient(root);
aura::client::GetScreenPositionClient(window->GetRootWindow());
if (screen_position_client)
screen_position_client->ConvertPointToScreen(root, point);
screen_position_client->ConvertPointToScreen(window, point);
}
void TouchEditableImplAura::ConvertPointFromScreen(gfx::Point* point) {
if (!rwhva_)
return;
aura::Window* window = rwhva_->GetNativeView();
aura::Window* root = window->GetRootWindow();
// If there is a screen position client, convert the point from screen to root
// window and then to client coordinates. Otherwise, suppose the point is in
// root window coordinates and convert it to client coordinates.
aura::client::ScreenPositionClient* screen_position_client =
aura::client::GetScreenPositionClient(root);
aura::client::GetScreenPositionClient(window->GetRootWindow());
if (screen_position_client)
screen_position_client->ConvertPointFromScreen(root, point);
aura::Window::ConvertPointToTarget(root, window, point);
screen_position_client->ConvertPointFromScreen(window, point);
}
bool TouchEditableImplAura::DrawsHandles() {
......
......@@ -167,13 +167,13 @@ IN_PROC_BROWSER_TEST_F(TouchEditableImplAuraTest,
// Check if selection handles are showing.
EXPECT_TRUE(GetTouchSelectionController(touch_editable));
EXPECT_EQ("Some text we can select", selection);
EXPECT_STREQ("Some text we can select", selection.c_str());
// Lets move the handles a bit to modify the selection
touch_editable->Reset();
generator.GestureScrollSequence(
gfx::Point(bounds.x() + 10, bounds.y() + 47),
gfx::Point(bounds.x() + 30, bounds.y() + 47),
gfx::Point(10, 47),
gfx::Point(30, 47),
base::TimeDelta::FromMilliseconds(20),
5);
touch_editable->WaitForSelectionChangeCallback();
......@@ -221,7 +221,7 @@ IN_PROC_BROWSER_TEST_F(TouchEditableImplAuraTest,
content::ExecuteScriptAndGetValue(main_frame, "get_selection()");
std::string selection;
value->GetAsString(&selection);
EXPECT_EQ("Some", selection);
EXPECT_STREQ("Some", selection.c_str());
// Start scrolling. Handles should get hidden.
ui::GestureEvent scroll_begin(ui::ET_GESTURE_SCROLL_BEGIN,
......@@ -282,7 +282,7 @@ IN_PROC_BROWSER_TEST_F(TouchEditableImplAuraTest,
content::ExecuteScriptAndGetValue(main_frame, "get_selection()");
std::string selection;
value->GetAsString(&selection);
EXPECT_EQ("Some", selection);
EXPECT_STREQ("Some", selection.c_str());
}
IN_PROC_BROWSER_TEST_F(TouchEditableImplAuraTest,
......@@ -318,13 +318,7 @@ IN_PROC_BROWSER_TEST_F(TouchEditableImplAuraTest,
content::ExecuteScriptAndGetValue(main_frame, "get_selection()");
std::string selection;
value->GetAsString(&selection);
#if defined(OS_WIN)
// In Windows, the default behavior is to select the whitespace after the word
// when the word is selected.
EXPECT_EQ("Some ", selection);
#else
EXPECT_EQ("Some", selection);
#endif // defined (OS_WIN)
EXPECT_STREQ("Some", selection.c_str());
}
IN_PROC_BROWSER_TEST_F(TouchEditableImplAuraTest,
......@@ -367,8 +361,8 @@ IN_PROC_BROWSER_TEST_F(TouchEditableImplAuraTest,
// Move the cursor handle.
generator.GestureScrollSequence(
gfx::Point(bounds.x() + 50, bounds.y() + 59),
gfx::Point(bounds.x() + 10, bounds.y() + 59),
gfx::Point(50, 59),
gfx::Point(10, 59),
base::TimeDelta::FromMilliseconds(20),
1);
touch_editable->WaitForSelectionChangeCallback();
......
......@@ -1169,6 +1169,11 @@
'test/webui_resource_browsertest.cc',
],
'conditions': [
['chromeos==0', {
'sources!': [
'browser/web_contents/touch_editable_impl_aura_browsertest.cc',
],
}],
['OS=="win"', {
'resource_include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)/webkit',
......
......@@ -732,7 +732,11 @@
'window/dialog_delegate_unittest.cc',
],
'conditions': [
['chromeos==1', {
['chromeos==0', {
'sources!': [
'touchui/touch_selection_controller_impl_unittest.cc',
],
}, { # use_chromeos==1
'sources/': [
['exclude', 'ime/input_method_bridge_unittest.cc'],
['exclude', 'widget/desktop_aura'],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment