|
|
Chromium Code Reviews|
Created:
4 years, 5 months ago by karandeepb Modified:
4 years, 5 months ago CC:
chromium-reviews, yusukes+watch_chromium.org, tdresser+watch_chromium.org, tfarina, shuchen+watch_chromium.org, nona+watch_chromium.org, James Su, chrome-apps-syd-reviews_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionMacViews: Modify cocoa_test_event_utils::SynthesizeKeyEvent to use the correct event timestamp value.
This CL fixes the following views_unittests, currently disabled on MacViews-
-TextfieldTest.DestroyingTextfieldFromOnKeyEvent
-TextfieldTest.FocusTraversalTest
-TextfieldTest.TextInputClientTest
These regressed in crrev.com/2007083002, which added a DCHECK to validate that
ui::Event::time_stamp comes from the same clock as TimeTicks::Now. These tests
fail since we are using a mocked system clock in tests, set using
SetEventTickClockForTesting in base_event_utils.h, against which the event
timestamp is validated. However cocoa_test_event_utils::SynthesizeKeyEvent uses
the actual/correct timestamp value, and not the mocked one.
This CL fixes the tests by using a timestamp value obtained from
ui::EventTimeForNow. This returns the mocked time (if applicable), or
base::TimeTicks::Now(). base::TimeTicks::Now() internally uses the same logic as
TimeIntervalSinceSystemStartup() did previously (i.e. mach_absolute_time()).
BUG=623420, 607403
Committed: https://crrev.com/84c48ee3ccb04d21a17e14428d15c64d17b3033f
Cr-Commit-Position: refs/heads/master@{#402708}
Patch Set 1 #
Total comments: 6
Patch Set 2 : Address review comments. #Patch Set 3 : Correct header order. #
Messages
Total messages: 21 (13 generated)
Description was changed from ========== Time fix 2 ========== to ========== MacViews: Modify cocoa_test_event_utils::SynthesizeKeyEvent to use the correct event timestamp value. This CL fixes the following views_unittests, currently disabled on MacViews- -TextfieldTest.DestroyingTextfieldFromOnKeyEvent -TextfieldTest.FocusTraversalTest -TextfieldTest.TextInputClientTest These regressed in crrev.com/2007083002, which added a DCHECK to validate that ui::Event::time_stamp comes from the same clock as TimeTicks::Now. These tests fail since we are using a mocked system clock in tests, set using SetEventTickClockForTesting in base_event_utils.h, against which the event timestamp is validated. However cocoa_test_event_utils::SynthesizeKeyEvent uses the actual/correct timestamp value, and not the mocked one. This CL fixes the tests by using a timestamp value obtained from ui::EventTimeForNow, which returns the mocked time, if the system clock is being mocked or the time since startup, if no mocked system clock is in place. ui::EventTimeForNow uses base::TimeTicks::Now() when the system clock is not mocked, which internally uses the same logic as that used by TimeIntervalSinceSystemStartup() currently. BUG=623420 ==========
Description was changed from ========== MacViews: Modify cocoa_test_event_utils::SynthesizeKeyEvent to use the correct event timestamp value. This CL fixes the following views_unittests, currently disabled on MacViews- -TextfieldTest.DestroyingTextfieldFromOnKeyEvent -TextfieldTest.FocusTraversalTest -TextfieldTest.TextInputClientTest These regressed in crrev.com/2007083002, which added a DCHECK to validate that ui::Event::time_stamp comes from the same clock as TimeTicks::Now. These tests fail since we are using a mocked system clock in tests, set using SetEventTickClockForTesting in base_event_utils.h, against which the event timestamp is validated. However cocoa_test_event_utils::SynthesizeKeyEvent uses the actual/correct timestamp value, and not the mocked one. This CL fixes the tests by using a timestamp value obtained from ui::EventTimeForNow, which returns the mocked time, if the system clock is being mocked or the time since startup, if no mocked system clock is in place. ui::EventTimeForNow uses base::TimeTicks::Now() when the system clock is not mocked, which internally uses the same logic as that used by TimeIntervalSinceSystemStartup() currently. BUG=623420 ========== to ========== MacViews: Modify cocoa_test_event_utils::SynthesizeKeyEvent to use the correct event timestamp value. This CL fixes the following views_unittests, currently disabled on MacViews- -TextfieldTest.DestroyingTextfieldFromOnKeyEvent -TextfieldTest.FocusTraversalTest -TextfieldTest.TextInputClientTest These regressed in crrev.com/2007083002, which added a DCHECK to validate that ui::Event::time_stamp comes from the same clock as TimeTicks::Now. These tests fail since we are using a mocked system clock in tests, set using SetEventTickClockForTesting in base_event_utils.h, against which the event timestamp is validated. However cocoa_test_event_utils::SynthesizeKeyEvent uses the actual/correct timestamp value, and not the mocked one. This CL fixes the tests by using a timestamp value obtained from ui::EventTimeForNow, which returns the mocked time, if the system clock is being mocked or the time since startup, if no mocked system clock is in place. ui::EventTimeForNow uses base::TimeTicks::Now() when the system clock is not mocked, which on Mac internally uses the same logic as that used by TimeIntervalSinceSystemStartup() currently. BUG=623420 ==========
Description was changed from ========== MacViews: Modify cocoa_test_event_utils::SynthesizeKeyEvent to use the correct event timestamp value. This CL fixes the following views_unittests, currently disabled on MacViews- -TextfieldTest.DestroyingTextfieldFromOnKeyEvent -TextfieldTest.FocusTraversalTest -TextfieldTest.TextInputClientTest These regressed in crrev.com/2007083002, which added a DCHECK to validate that ui::Event::time_stamp comes from the same clock as TimeTicks::Now. These tests fail since we are using a mocked system clock in tests, set using SetEventTickClockForTesting in base_event_utils.h, against which the event timestamp is validated. However cocoa_test_event_utils::SynthesizeKeyEvent uses the actual/correct timestamp value, and not the mocked one. This CL fixes the tests by using a timestamp value obtained from ui::EventTimeForNow, which returns the mocked time, if the system clock is being mocked or the time since startup, if no mocked system clock is in place. ui::EventTimeForNow uses base::TimeTicks::Now() when the system clock is not mocked, which on Mac internally uses the same logic as that used by TimeIntervalSinceSystemStartup() currently. BUG=623420 ========== to ========== MacViews: Modify cocoa_test_event_utils::SynthesizeKeyEvent to use the correct event timestamp value. This CL fixes the following views_unittests, currently disabled on MacViews- -TextfieldTest.DestroyingTextfieldFromOnKeyEvent -TextfieldTest.FocusTraversalTest -TextfieldTest.TextInputClientTest These regressed in crrev.com/2007083002, which added a DCHECK to validate that ui::Event::time_stamp comes from the same clock as TimeTicks::Now. These tests fail since we are using a mocked system clock in tests, set using SetEventTickClockForTesting in base_event_utils.h, against which the event timestamp is validated. However cocoa_test_event_utils::SynthesizeKeyEvent uses the actual/correct timestamp value, and not the mocked one. This CL fixes the tests by using a timestamp value obtained from ui::EventTimeForNow, which returns the mocked time, if the system clock is being mocked or the time since startup, if no mocked system clock is in place. ui::EventTimeForNow uses base::TimeTicks::Now() when the system clock is not mocked, which on Mac internally uses the same logic as that used by TimeIntervalSinceSystemStartup() currently. BUG=623420, 607403 ==========
karandeepb@chromium.org changed reviewers: + tapted@chromium.org
PTAL Trent. Thanks.
lgtm https://codereview.chromium.org/2101903002/diff/1/ui/events/test/cocoa_test_e... File ui/events/test/cocoa_test_event_utils.mm (right): https://codereview.chromium.org/2101903002/diff/1/ui/events/test/cocoa_test_e... ui/events/test/cocoa_test_event_utils.mm:1: // Copyright 2014 The Chromium Authors. All rights reserved. CL description nit: start a new paragraph for "This CL fixes..". And break it up a bit. I think there's a type or two as well E.g. This CL fixes the tests by using a timestamp value obtained from ui::EventTimeForNow. This returns the mocked time (if applicable), or base::TimeTicks::Now(). base::TimeTicks::Now() internally uses the same logic as TimeIntervalSinceSystemStartup() did previously (i.e. mach_absolute_time()) https://codereview.chromium.org/2101903002/diff/1/ui/events/test/cocoa_test_e... ui/events/test/cocoa_test_event_utils.mm:11: #include "ui/events/test/cocoa_test_event_utils.h" nit (while you're here), this should be before <Cocoa/Cocoa.h>, and #imported https://codereview.chromium.org/2101903002/diff/1/ui/events/test/cocoa_test_e... ui/events/test/cocoa_test_event_utils.mm:160: return time_elapsed.InSeconds(); InSeconds -> InSecondsF
Description was changed from ========== MacViews: Modify cocoa_test_event_utils::SynthesizeKeyEvent to use the correct event timestamp value. This CL fixes the following views_unittests, currently disabled on MacViews- -TextfieldTest.DestroyingTextfieldFromOnKeyEvent -TextfieldTest.FocusTraversalTest -TextfieldTest.TextInputClientTest These regressed in crrev.com/2007083002, which added a DCHECK to validate that ui::Event::time_stamp comes from the same clock as TimeTicks::Now. These tests fail since we are using a mocked system clock in tests, set using SetEventTickClockForTesting in base_event_utils.h, against which the event timestamp is validated. However cocoa_test_event_utils::SynthesizeKeyEvent uses the actual/correct timestamp value, and not the mocked one. This CL fixes the tests by using a timestamp value obtained from ui::EventTimeForNow, which returns the mocked time, if the system clock is being mocked or the time since startup, if no mocked system clock is in place. ui::EventTimeForNow uses base::TimeTicks::Now() when the system clock is not mocked, which on Mac internally uses the same logic as that used by TimeIntervalSinceSystemStartup() currently. BUG=623420, 607403 ========== to ========== MacViews: Modify cocoa_test_event_utils::SynthesizeKeyEvent to use the correct event timestamp value. This CL fixes the following views_unittests, currently disabled on MacViews- -TextfieldTest.DestroyingTextfieldFromOnKeyEvent -TextfieldTest.FocusTraversalTest -TextfieldTest.TextInputClientTest These regressed in crrev.com/2007083002, which added a DCHECK to validate that ui::Event::time_stamp comes from the same clock as TimeTicks::Now. These tests fail since we are using a mocked system clock in tests, set using SetEventTickClockForTesting in base_event_utils.h, against which the event timestamp is validated. However cocoa_test_event_utils::SynthesizeKeyEvent uses the actual/correct timestamp value, and not the mocked one. This CL fixes the tests by using a timestamp value obtained from ui::EventTimeForNow. This returns the mocked time (if applicable), or base::TimeTicks::Now(). base::TimeTicks::Now() internally uses the same logic as TimeIntervalSinceSystemStartup() did previously (i.e. mach_absolute_time()). ==========
Description was changed from ========== MacViews: Modify cocoa_test_event_utils::SynthesizeKeyEvent to use the correct event timestamp value. This CL fixes the following views_unittests, currently disabled on MacViews- -TextfieldTest.DestroyingTextfieldFromOnKeyEvent -TextfieldTest.FocusTraversalTest -TextfieldTest.TextInputClientTest These regressed in crrev.com/2007083002, which added a DCHECK to validate that ui::Event::time_stamp comes from the same clock as TimeTicks::Now. These tests fail since we are using a mocked system clock in tests, set using SetEventTickClockForTesting in base_event_utils.h, against which the event timestamp is validated. However cocoa_test_event_utils::SynthesizeKeyEvent uses the actual/correct timestamp value, and not the mocked one. This CL fixes the tests by using a timestamp value obtained from ui::EventTimeForNow. This returns the mocked time (if applicable), or base::TimeTicks::Now(). base::TimeTicks::Now() internally uses the same logic as TimeIntervalSinceSystemStartup() did previously (i.e. mach_absolute_time()). ========== to ========== MacViews: Modify cocoa_test_event_utils::SynthesizeKeyEvent to use the correct event timestamp value. This CL fixes the following views_unittests, currently disabled on MacViews- -TextfieldTest.DestroyingTextfieldFromOnKeyEvent -TextfieldTest.FocusTraversalTest -TextfieldTest.TextInputClientTest These regressed in crrev.com/2007083002, which added a DCHECK to validate that ui::Event::time_stamp comes from the same clock as TimeTicks::Now. These tests fail since we are using a mocked system clock in tests, set using SetEventTickClockForTesting in base_event_utils.h, against which the event timestamp is validated. However cocoa_test_event_utils::SynthesizeKeyEvent uses the actual/correct timestamp value, and not the mocked one. This CL fixes the tests by using a timestamp value obtained from ui::EventTimeForNow. This returns the mocked time (if applicable), or base::TimeTicks::Now(). base::TimeTicks::Now() internally uses the same logic as TimeIntervalSinceSystemStartup() did previously (i.e. mach_absolute_time()). BUG=623420, 607403 ==========
Patchset #2 (id:20001) has been deleted
Patchset #2 (id:40001) has been deleted
https://codereview.chromium.org/2101903002/diff/1/ui/events/test/cocoa_test_e... File ui/events/test/cocoa_test_event_utils.mm (right): https://codereview.chromium.org/2101903002/diff/1/ui/events/test/cocoa_test_e... ui/events/test/cocoa_test_event_utils.mm:1: // Copyright 2014 The Chromium Authors. All rights reserved. On 2016/06/28 05:07:41, tapted wrote: > CL description nit: start a new paragraph for "This CL fixes..". And break it up > a bit. I think there's a type or two as well E.g. > > This CL fixes the tests by using a timestamp value obtained from > ui::EventTimeForNow. This returns the mocked time (if applicable), or > base::TimeTicks::Now(). base::TimeTicks::Now() internally uses the same logic as > TimeIntervalSinceSystemStartup() did previously (i.e. mach_absolute_time()) Done. https://codereview.chromium.org/2101903002/diff/1/ui/events/test/cocoa_test_e... ui/events/test/cocoa_test_event_utils.mm:11: #include "ui/events/test/cocoa_test_event_utils.h" On 2016/06/28 05:07:41, tapted wrote: > nit (while you're here), this should be before <Cocoa/Cocoa.h>, and #imported Done. https://codereview.chromium.org/2101903002/diff/1/ui/events/test/cocoa_test_e... ui/events/test/cocoa_test_event_utils.mm:160: return time_elapsed.InSeconds(); On 2016/06/28 05:07:41, tapted wrote: > InSeconds -> InSecondsF Done.
karandeepb@chromium.org changed reviewers: + sky@chromium.org
+sky for ui/ review.
LGTM
The CQ bit was checked by karandeepb@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from tapted@chromium.org Link to the patchset: https://codereview.chromium.org/2101903002/#ps80001 (title: "Correct header order.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== MacViews: Modify cocoa_test_event_utils::SynthesizeKeyEvent to use the correct event timestamp value. This CL fixes the following views_unittests, currently disabled on MacViews- -TextfieldTest.DestroyingTextfieldFromOnKeyEvent -TextfieldTest.FocusTraversalTest -TextfieldTest.TextInputClientTest These regressed in crrev.com/2007083002, which added a DCHECK to validate that ui::Event::time_stamp comes from the same clock as TimeTicks::Now. These tests fail since we are using a mocked system clock in tests, set using SetEventTickClockForTesting in base_event_utils.h, against which the event timestamp is validated. However cocoa_test_event_utils::SynthesizeKeyEvent uses the actual/correct timestamp value, and not the mocked one. This CL fixes the tests by using a timestamp value obtained from ui::EventTimeForNow. This returns the mocked time (if applicable), or base::TimeTicks::Now(). base::TimeTicks::Now() internally uses the same logic as TimeIntervalSinceSystemStartup() did previously (i.e. mach_absolute_time()). BUG=623420, 607403 ========== to ========== MacViews: Modify cocoa_test_event_utils::SynthesizeKeyEvent to use the correct event timestamp value. This CL fixes the following views_unittests, currently disabled on MacViews- -TextfieldTest.DestroyingTextfieldFromOnKeyEvent -TextfieldTest.FocusTraversalTest -TextfieldTest.TextInputClientTest These regressed in crrev.com/2007083002, which added a DCHECK to validate that ui::Event::time_stamp comes from the same clock as TimeTicks::Now. These tests fail since we are using a mocked system clock in tests, set using SetEventTickClockForTesting in base_event_utils.h, against which the event timestamp is validated. However cocoa_test_event_utils::SynthesizeKeyEvent uses the actual/correct timestamp value, and not the mocked one. This CL fixes the tests by using a timestamp value obtained from ui::EventTimeForNow. This returns the mocked time (if applicable), or base::TimeTicks::Now(). base::TimeTicks::Now() internally uses the same logic as TimeIntervalSinceSystemStartup() did previously (i.e. mach_absolute_time()). BUG=623420, 607403 ==========
Message was sent while issue was closed.
Committed patchset #3 (id:80001)
Message was sent while issue was closed.
Description was changed from ========== MacViews: Modify cocoa_test_event_utils::SynthesizeKeyEvent to use the correct event timestamp value. This CL fixes the following views_unittests, currently disabled on MacViews- -TextfieldTest.DestroyingTextfieldFromOnKeyEvent -TextfieldTest.FocusTraversalTest -TextfieldTest.TextInputClientTest These regressed in crrev.com/2007083002, which added a DCHECK to validate that ui::Event::time_stamp comes from the same clock as TimeTicks::Now. These tests fail since we are using a mocked system clock in tests, set using SetEventTickClockForTesting in base_event_utils.h, against which the event timestamp is validated. However cocoa_test_event_utils::SynthesizeKeyEvent uses the actual/correct timestamp value, and not the mocked one. This CL fixes the tests by using a timestamp value obtained from ui::EventTimeForNow. This returns the mocked time (if applicable), or base::TimeTicks::Now(). base::TimeTicks::Now() internally uses the same logic as TimeIntervalSinceSystemStartup() did previously (i.e. mach_absolute_time()). BUG=623420, 607403 ========== to ========== MacViews: Modify cocoa_test_event_utils::SynthesizeKeyEvent to use the correct event timestamp value. This CL fixes the following views_unittests, currently disabled on MacViews- -TextfieldTest.DestroyingTextfieldFromOnKeyEvent -TextfieldTest.FocusTraversalTest -TextfieldTest.TextInputClientTest These regressed in crrev.com/2007083002, which added a DCHECK to validate that ui::Event::time_stamp comes from the same clock as TimeTicks::Now. These tests fail since we are using a mocked system clock in tests, set using SetEventTickClockForTesting in base_event_utils.h, against which the event timestamp is validated. However cocoa_test_event_utils::SynthesizeKeyEvent uses the actual/correct timestamp value, and not the mocked one. This CL fixes the tests by using a timestamp value obtained from ui::EventTimeForNow. This returns the mocked time (if applicable), or base::TimeTicks::Now(). base::TimeTicks::Now() internally uses the same logic as TimeIntervalSinceSystemStartup() did previously (i.e. mach_absolute_time()). BUG=623420, 607403 Committed: https://crrev.com/84c48ee3ccb04d21a17e14428d15c64d17b3033f Cr-Commit-Position: refs/heads/master@{#402708} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/84c48ee3ccb04d21a17e14428d15c64d17b3033f Cr-Commit-Position: refs/heads/master@{#402708} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
