New issue
Advanced search Search tips

Issue 623455 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 1
Type: Bug



Sign in to add a comment

MacViews: Investigate views_unittests flakes after switching on for the bots

Project Member Reported by tapted@chromium.org, Jun 27 2016

Issue description

Chrome Version       : 53.0.2774.3

An initial set of things that may fail once but (so far..) succeed reliably on retries. These should be disabled if we can't find a fix quickly since it's likely they will eventually fail retries too.

Some are tests involving the system clipboard - see  Issue 623442 

Flakes on 10.9

[ RUN      ] MenuRunnerCocoaTest.RunMenuAndCancel
../../ui/views/controls/menu/menu_runner_cocoa_unittest.mm:182: Failure
Expected: (runner_->GetClosingEventTime()) <= ((ui::EventTimeForNow() - base::TimeTicks())), actual: 13647.4s vs 0.002s


From a waterfall run: https://build.chromium.org/p/chromium.mac/builders/Mac10.9%20Tests/builds/23874/steps/views_unittests%20on%20Mac-10.9/logs/stdio
TextfieldTest.UndoRedoTest (326 ms)
TextfieldTest.ContextMenuDisplayTest (79 ms)
MenuRunnerCocoaTest.RunMenuAndCancel (78 ms)

UndoRedoTest and ContextMenuDisplayTest are actually crashing here, which is different to  Issue 623442 


Flakes on 10.10

[ RUN      ] NativeWidgetMacTest.HideAndShowExternally
[28139:1299:0626/170546:8328019624287:ERROR:native_widget_mac.mm(282)] Not implemented reached in virtual void views::NativeWidgetMac::SetWindowIcons(const gfx::ImageSkia &, const gfx::ImageSkia &)
../../ui/views/widget/native_widget_mac_unittest.mm:314: Failure
Value of: widget->IsVisible()
  Actual: true
Expected: false


[ RUN      ] TextfieldModelTest.UndoRedo_CutCopyPasteTest
../../ui/views/controls/textfield/textfield_model_unittest.cc:1277: Failure
Value of: model.text()
  Actual: 12345
Expected: base::ASCIIToUTF16("1232345")
Which is: 1232345
../../ui/views/controls/textfield/textfield_model_unittest.cc:1278: Failure
Value of: model.GetCursorPosition()
  Actual: 3
Expected: 5U
Which is: 5
...

[ RUN      ] TextfieldModelTest.Clipboard_WhiteSpaceStringTest
../../ui/views/controls/textfield/textfield_model_unittest.cc:1505: Failure
Value of: model.text()
  Actual: HELLO WORLD23
Expected: base::ASCIIToUTF16("HELLO WORLDB")
Which is: HELLO WORLDB


[ RUN      ] TextfieldTest.PasswordTest
../../ui/views/controls/textfield/textfield_unittest.cc:938: Failure
Value of: GetClipboardText(ui::CLIPBOARD_TYPE_COPY_PASTE)
  Actual: HELLO 
Expected: ASCIIToUTF16("foo")
Which is: foo
<sometimes>
../../ui/views/controls/textfield/textfield_unittest.cc:939: Failure
Value of: textfield_->text()
  Actual: foofooHELLO
Expected: ASCIIToUTF16("foofoofoo")
Which is: foofoofoo
</sometimes>

 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 1 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/80f15fe17e9095bd4d6c11d94db8e1dd42556458

commit 80f15fe17e9095bd4d6c11d94db8e1dd42556458
Author: tapted <tapted@chromium.org>
Date: Fri Jul 01 00:36:49 2016

Deflake Mac views_unittest's MenuRunnerCocoaTest.RunMenuAndCancel

The test occasionally fails with

menu_runner_cocoa_unittest.mm:182: Failure
Expected: (runner_->GetClosingEventTime())
    <= (ui::EventTimeForNow() - base::TimeTicks())),
actual: 13647.4s vs 0.002s

It happens because menu_runner_impl_cocoa.mm uses
base::TimeTicks::Now(), but the test uses ui::EventTimeForNow() to set
expectations. Usually this isn't a problem, but if another unit test in
the same process has created a ui::EventGenerator, this sets a mock time
source with ui::SetEventTickClockForTesting(..) which isn't cleared when
the EventGenerator is destroyed.

Fix both problems. The EventGenerator destructor should reset the global
state it created, and menu_runner_impl_cocoa.mm should use
ui::EventTimeForNow() for better consistency.

BUG= 623455 ,  624555 

Review-Url: https://codereview.chromium.org/2094193002
Cr-Commit-Position: refs/heads/master@{#403373}

[modify] https://crrev.com/80f15fe17e9095bd4d6c11d94db8e1dd42556458/ui/events/test/event_generator.cc
[modify] https://crrev.com/80f15fe17e9095bd4d6c11d94db8e1dd42556458/ui/views/controls/menu/menu_runner_cocoa_unittest.mm
[modify] https://crrev.com/80f15fe17e9095bd4d6c11d94db8e1dd42556458/ui/views/controls/menu/menu_runner_impl_cocoa.mm

Status: Fixed (was: Assigned)
The only remaining thing I'm aware of is  Issue 623442  (system clipboard stuff), so let's follow up there.

Sign in to add a comment