Chromium Code Reviews| Index: ui/views/touchui/touch_selection_controller_impl_unittest.cc |
| diff --git a/ui/views/touchui/touch_selection_controller_impl_unittest.cc b/ui/views/touchui/touch_selection_controller_impl_unittest.cc |
| index e3983dc045918d803a0be91e8af25841c5be4888..787f2ebbb58accce845acc9d6594f05adf734086 100644 |
| --- a/ui/views/touchui/touch_selection_controller_impl_unittest.cc |
| +++ b/ui/views/touchui/touch_selection_controller_impl_unittest.cc |
| @@ -75,15 +75,19 @@ class TouchSelectionControllerImplTest : public ViewsTestBase { |
| void SetUp() override { |
| ViewsTestBase::SetUp(); |
| + if (IsAuraMusClient()) |
| + return; |
| test_cursor_client_.reset(new aura::test::TestCursorClient(GetContext())); |
| } |
| void TearDown() override { |
| - test_cursor_client_.reset(); |
| - if (textfield_widget_ && !textfield_widget_->IsClosed()) |
| - textfield_widget_->Close(); |
| - if (widget_ && !widget_->IsClosed()) |
| - widget_->Close(); |
| + if (!IsAuraMusClient()) { |
|
msw
2016/11/11 00:29:24
nit: only use the conditional for test_cursor_clie
sky
2016/11/11 01:09:14
Done.
|
| + test_cursor_client_.reset(); |
| + if (textfield_widget_ && !textfield_widget_->IsClosed()) |
| + textfield_widget_->Close(); |
| + if (widget_ && !widget_->IsClosed()) |
| + widget_->Close(); |
| + } |
| ViewsTestBase::TearDown(); |
| } |
| @@ -318,6 +322,11 @@ class TouchSelectionControllerImplTest : public ViewsTestBase { |
| // Tests that the selection handles are placed appropriately when selection in |
| // a Textfield changes. |
| TEST_F(TouchSelectionControllerImplTest, SelectionInTextfieldTest) { |
| + // TODO: test uses GetContext(), which is not applicable to aura-mus. |
| + // http://crbug.com/663809. |
| + if (IsAuraMusClient()) |
| + return; |
| + |
| CreateTextfield(); |
| textfield_->SetText(ASCIIToUTF16("some text")); |
| // Tap the textfield to invoke touch selection. |
| @@ -351,6 +360,11 @@ TEST_F(TouchSelectionControllerImplTest, SelectionInTextfieldTest) { |
| // Tests that the selection handles are placed appropriately in bidi text. |
| TEST_F(TouchSelectionControllerImplTest, SelectionInBidiTextfieldTest) { |
| + // TODO: test uses GetContext(), which is not applicable to aura-mus. |
| + // http://crbug.com/663809. |
| + if (IsAuraMusClient()) |
| + return; |
| + |
| CreateTextfield(); |
| textfield_->SetText(WideToUTF16(L"abc\x05d0\x05d1\x05d2")); |
| // Tap the textfield to invoke touch selection. |
| @@ -403,6 +417,11 @@ TEST_F(TouchSelectionControllerImplTest, SelectionInBidiTextfieldTest) { |
| // Tests if the SelectRect callback is called appropriately when selection |
| // handles are moved. |
| TEST_F(TouchSelectionControllerImplTest, SelectRectCallbackTest) { |
| + // TODO: test uses GetContext(), which is not applicable to aura-mus. |
| + // http://crbug.com/663809. |
| + if (IsAuraMusClient()) |
| + return; |
| + |
| CreateTextfield(); |
| textfield_->SetText(ASCIIToUTF16("textfield with selected text")); |
| // Tap the textfield to invoke touch selection. |
| @@ -445,6 +464,11 @@ TEST_F(TouchSelectionControllerImplTest, SelectRectCallbackTest) { |
| } |
| TEST_F(TouchSelectionControllerImplTest, SelectRectInBidiCallbackTest) { |
| + // TODO: test uses GetContext(), which is not applicable to aura-mus. |
| + // http://crbug.com/663809. |
| + if (IsAuraMusClient()) |
| + return; |
| + |
| CreateTextfield(); |
| textfield_->SetText(WideToUTF16(L"abc\x05e1\x05e2\x05e3" L"def")); |
| // Tap the textfield to invoke touch selection. |
| @@ -573,6 +597,11 @@ TEST_F(TouchSelectionControllerImplTest, SelectRectInBidiCallbackTest) { |
| TEST_F(TouchSelectionControllerImplTest, |
| HiddenSelectionHandleRetainsCursorPosition) { |
| + // TODO: test uses GetContext(), which is not applicable to aura-mus. |
|
msw
2016/11/11 00:29:24
optional nit: Move the meaty comment to SetUp and
sky
2016/11/11 01:09:14
Done.
|
| + // http://crbug.com/663809. |
| + if (IsAuraMusClient()) |
| + return; |
| + |
| static const uint32_t selection_start = 10u; |
| SetupSelectionInvisibleHandle(selection_start); |
| // Drag the visible handle around and make sure the selection end point of the |
| @@ -591,6 +620,11 @@ TEST_F(TouchSelectionControllerImplTest, |
| // Tests that we can handle the hidden handle getting exposed as a result of a |
| // drag and that it maintains the correct orientation when exposed. |
| TEST_F(TouchSelectionControllerImplTest, HiddenSelectionHandleExposed) { |
| + // TODO: test uses GetContext(), which is not applicable to aura-mus. |
| + // http://crbug.com/663809. |
| + if (IsAuraMusClient()) |
| + return; |
| + |
| static const uint32_t selection_start = 0u; |
| SetupSelectionInvisibleHandle(selection_start); |
| @@ -608,6 +642,11 @@ TEST_F(TouchSelectionControllerImplTest, HiddenSelectionHandleExposed) { |
| TEST_F(TouchSelectionControllerImplTest, |
| DoubleTapInTextfieldWithCursorHandleShouldSelectText) { |
| + // TODO: test uses GetContext(), which is not applicable to aura-mus. |
| + // http://crbug.com/663809. |
| + if (IsAuraMusClient()) |
| + return; |
| + |
| CreateTextfield(); |
| textfield_->SetText(ASCIIToUTF16("some text")); |
| ui::test::EventGenerator generator( |
| @@ -707,6 +746,11 @@ class TestTouchEditable : public ui::TouchEditable { |
| // the cursor position relative to the client boundaries. |
| TEST_F(TouchSelectionControllerImplTest, |
| VisibilityOfHandleRegardingClientBounds) { |
| + // TODO: test uses GetContext(), which is not applicable to aura-mus. |
| + // http://crbug.com/663809. |
| + if (IsAuraMusClient()) |
| + return; |
| + |
| CreateWidget(); |
| TestTouchEditable touch_editable(widget_->GetNativeView()); |
| @@ -754,6 +798,11 @@ TEST_F(TouchSelectionControllerImplTest, |
| } |
| TEST_F(TouchSelectionControllerImplTest, HandlesStackAboveParent) { |
| + // TODO: test uses GetContext(), which is not applicable to aura-mus. |
| + // http://crbug.com/663809. |
| + if (IsAuraMusClient()) |
| + return; |
| + |
| ui::EventTarget* root = GetContext(); |
| ui::EventTargeter* targeter = root->GetEventTargeter(); |
| @@ -792,6 +841,11 @@ TEST_F(TouchSelectionControllerImplTest, HandlesStackAboveParent) { |
| } |
| TEST_F(TouchSelectionControllerImplTest, MouseEventDeactivatesTouchSelection) { |
| + // TODO: test uses GetContext(), which is not applicable to aura-mus. |
| + // http://crbug.com/663809. |
| + if (IsAuraMusClient()) |
| + return; |
| + |
| CreateTextfield(); |
| EXPECT_FALSE(GetSelectionController()); |
| @@ -833,6 +887,11 @@ TEST_F(TouchSelectionControllerImplTest, MouseEventDeactivatesTouchSelection) { |
| } |
| TEST_F(TouchSelectionControllerImplTest, MouseCaptureChangedEventIgnored) { |
| + // TODO: test uses GetContext(), which is not applicable to aura-mus. |
| + // http://crbug.com/663809. |
| + if (IsAuraMusClient()) |
| + return; |
| + |
| CreateTextfield(); |
| EXPECT_FALSE(GetSelectionController()); |
| @@ -852,6 +911,11 @@ TEST_F(TouchSelectionControllerImplTest, MouseCaptureChangedEventIgnored) { |
| } |
| TEST_F(TouchSelectionControllerImplTest, KeyEventDeactivatesTouchSelection) { |
| + // TODO: test uses GetContext(), which is not applicable to aura-mus. |
| + // http://crbug.com/663809. |
| + if (IsAuraMusClient()) |
| + return; |
| + |
| CreateTextfield(); |
| EXPECT_FALSE(GetSelectionController()); |