Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: third_party/WebKit/Source/modules/media_controls/MediaControlsImplTest.cpp

Issue 2802233002: [Media Controls] Temporarily disable failing metrics tests on Android (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/media_controls/MediaControlsImpl.h" 5 #include "modules/media_controls/MediaControlsImpl.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <memory> 8 #include <memory>
9 #include "core/HTMLNames.h" 9 #include "core/HTMLNames.h"
10 #include "core/css/StylePropertySet.h" 10 #include "core/css/StylePropertySet.h"
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 histogramTester().expectUniqueSample( 613 histogramTester().expectUniqueSample(
614 "Media.Timeline.Width.InlineLandscape", 614 "Media.Timeline.Width.InlineLandscape",
615 timeline->getBoundingClientRect()->width(), 1); 615 timeline->getBoundingClientRect()->width(), 1);
616 histogramTester().expectTotalCount("Media.Timeline.Width.InlinePortrait", 0); 616 histogramTester().expectTotalCount("Media.Timeline.Width.InlinePortrait", 0);
617 histogramTester().expectTotalCount("Media.Timeline.Width.FullscreenLandscape", 617 histogramTester().expectTotalCount("Media.Timeline.Width.FullscreenLandscape",
618 0); 618 0);
619 histogramTester().expectTotalCount("Media.Timeline.Width.FullscreenPortrait", 619 histogramTester().expectTotalCount("Media.Timeline.Width.FullscreenPortrait",
620 0); 620 0);
621 } 621 }
622 622
623 TEST_F(MediaControlsImplTest, TimelineMetricsClick) { 623 // TODO(johnme): Fix and re-enable this on Android.
624 #if OS(ANDROID)
625 #define MAYBE_TimelineMetricsClick DISABLED_TimelineMetricsClick
626 #else
627 #define MAYBE_TimelineMetricsClick TimelineMetricsClick
628 #endif
629 TEST_F(MediaControlsImplTest, MAYBE_TimelineMetricsClick) {
624 double duration = 540; // 9 minutes 630 double duration = 540; // 9 minutes
625 loadMediaWithDuration(duration); 631 loadMediaWithDuration(duration);
626 ensureSizing(); 632 ensureSizing();
627 testing::runPendingTasks(); 633 testing::runPendingTasks();
628 634
629 ASSERT_TRUE(isElementVisible(*mediaControls().timelineElement())); 635 ASSERT_TRUE(isElementVisible(*mediaControls().timelineElement()));
630 ClientRect* timelineRect = 636 ClientRect* timelineRect =
631 mediaControls().timelineElement()->getBoundingClientRect(); 637 mediaControls().timelineElement()->getBoundingClientRect();
632 ASSERT_LT(0, timelineRect->width()); 638 ASSERT_LT(0, timelineRect->width());
633 639
(...skipping 11 matching lines...) Expand all
645 histogramTester().expectUniqueSample("Media.Timeline.SeekType.128_255", 651 histogramTester().expectUniqueSample("Media.Timeline.SeekType.128_255",
646 0 /* SeekType::kClick */, 1); 652 0 /* SeekType::kClick */, 1);
647 histogramTester().expectTotalCount( 653 histogramTester().expectTotalCount(
648 "Media.Timeline.DragGestureDuration.128_255", 0); 654 "Media.Timeline.DragGestureDuration.128_255", 0);
649 histogramTester().expectTotalCount("Media.Timeline.DragPercent.128_255", 0); 655 histogramTester().expectTotalCount("Media.Timeline.DragPercent.128_255", 0);
650 histogramTester().expectTotalCount( 656 histogramTester().expectTotalCount(
651 "Media.Timeline.DragSumAbsTimeDelta.128_255", 0); 657 "Media.Timeline.DragSumAbsTimeDelta.128_255", 0);
652 histogramTester().expectTotalCount("Media.Timeline.DragTimeDelta.128_255", 0); 658 histogramTester().expectTotalCount("Media.Timeline.DragTimeDelta.128_255", 0);
653 } 659 }
654 660
655 TEST_F(MediaControlsImplTest, TimelineMetricsDragFromCurrentPosition) { 661 // TODO(johnme): Fix and re-enable this on Android.
662 #if OS(ANDROID)
663 #define MAYBE_TimelineMetricsDragFromCurrentPosition \
664 DISABLED_TimelineMetricsDragFromCurrentPosition
665 #else
666 #define MAYBE_TimelineMetricsDragFromCurrentPosition \
667 TimelineMetricsDragFromCurrentPosition
668 #endif
669 TEST_F(MediaControlsImplTest, MAYBE_TimelineMetricsDragFromCurrentPosition) {
656 double duration = 540; // 9 minutes 670 double duration = 540; // 9 minutes
657 loadMediaWithDuration(duration); 671 loadMediaWithDuration(duration);
658 ensureSizing(); 672 ensureSizing();
659 testing::runPendingTasks(); 673 testing::runPendingTasks();
660 674
661 ASSERT_TRUE(isElementVisible(*mediaControls().timelineElement())); 675 ASSERT_TRUE(isElementVisible(*mediaControls().timelineElement()));
662 ClientRect* timelineRect = 676 ClientRect* timelineRect =
663 mediaControls().timelineElement()->getBoundingClientRect(); 677 mediaControls().timelineElement()->getBoundingClientRect();
664 ASSERT_LT(0, timelineRect->width()); 678 ASSERT_LT(0, timelineRect->width());
665 679
(...skipping 16 matching lines...) Expand all
682 histogramTester().expectTotalCount( 696 histogramTester().expectTotalCount(
683 "Media.Timeline.DragGestureDuration.128_255", 1); 697 "Media.Timeline.DragGestureDuration.128_255", 1);
684 histogramTester().expectUniqueSample("Media.Timeline.DragPercent.128_255", 698 histogramTester().expectUniqueSample("Media.Timeline.DragPercent.128_255",
685 47 /* [60.0%, 70.0%) */, 1); 699 47 /* [60.0%, 70.0%) */, 1);
686 histogramTester().expectUniqueSample( 700 histogramTester().expectUniqueSample(
687 "Media.Timeline.DragSumAbsTimeDelta.128_255", 16 /* [4m, 8m) */, 1); 701 "Media.Timeline.DragSumAbsTimeDelta.128_255", 16 /* [4m, 8m) */, 1);
688 histogramTester().expectUniqueSample("Media.Timeline.DragTimeDelta.128_255", 702 histogramTester().expectUniqueSample("Media.Timeline.DragTimeDelta.128_255",
689 40 /* [4m, 8m) */, 1); 703 40 /* [4m, 8m) */, 1);
690 } 704 }
691 705
692 TEST_F(MediaControlsImplTest, TimelineMetricsDragFromElsewhere) { 706 // TODO(johnme): Fix and re-enable this on Android.
707 #if OS(ANDROID)
708 #define MAYBE_TimelineMetricsDragFromElsewhere \
709 DISABLED_TimelineMetricsDragFromElsewhere
710 #else
711 #define MAYBE_TimelineMetricsDragFromElsewhere TimelineMetricsDragFromElsewhere
712 #endif
713 TEST_F(MediaControlsImplTest, MAYBE_TimelineMetricsDragFromElsewhere) {
693 double duration = 540; // 9 minutes 714 double duration = 540; // 9 minutes
694 loadMediaWithDuration(duration); 715 loadMediaWithDuration(duration);
695 ensureSizing(); 716 ensureSizing();
696 testing::runPendingTasks(); 717 testing::runPendingTasks();
697 718
698 ASSERT_TRUE(isElementVisible(*mediaControls().timelineElement())); 719 ASSERT_TRUE(isElementVisible(*mediaControls().timelineElement()));
699 ClientRect* timelineRect = 720 ClientRect* timelineRect =
700 mediaControls().timelineElement()->getBoundingClientRect(); 721 mediaControls().timelineElement()->getBoundingClientRect();
701 ASSERT_LT(0, timelineRect->width()); 722 ASSERT_LT(0, timelineRect->width());
702 723
(...skipping 16 matching lines...) Expand all
719 histogramTester().expectTotalCount( 740 histogramTester().expectTotalCount(
720 "Media.Timeline.DragGestureDuration.128_255", 1); 741 "Media.Timeline.DragGestureDuration.128_255", 1);
721 histogramTester().expectUniqueSample("Media.Timeline.DragPercent.128_255", 742 histogramTester().expectUniqueSample("Media.Timeline.DragPercent.128_255",
722 42 /* [30.0%, 35.0%) */, 1); 743 42 /* [30.0%, 35.0%) */, 1);
723 histogramTester().expectUniqueSample( 744 histogramTester().expectUniqueSample(
724 "Media.Timeline.DragSumAbsTimeDelta.128_255", 15 /* [2m, 4m) */, 1); 745 "Media.Timeline.DragSumAbsTimeDelta.128_255", 15 /* [2m, 4m) */, 1);
725 histogramTester().expectUniqueSample("Media.Timeline.DragTimeDelta.128_255", 746 histogramTester().expectUniqueSample("Media.Timeline.DragTimeDelta.128_255",
726 39 /* [2m, 4m) */, 1); 747 39 /* [2m, 4m) */, 1);
727 } 748 }
728 749
729 TEST_F(MediaControlsImplTest, TimelineMetricsDragBackAndForth) { 750 // TODO(johnme): Fix and re-enable this on Android.
751 #if OS(ANDROID)
752 #define MAYBE_TimelineMetricsDragBackAndForth \
753 DISABLED_TimelineMetricsDragBackAndForth
754 #else
755 #define MAYBE_TimelineMetricsDragBackAndForth TimelineMetricsDragBackAndForth
756 #endif
757 TEST_F(MediaControlsImplTest, MAYBE_TimelineMetricsDragBackAndForth) {
730 double duration = 540; // 9 minutes 758 double duration = 540; // 9 minutes
731 loadMediaWithDuration(duration); 759 loadMediaWithDuration(duration);
732 ensureSizing(); 760 ensureSizing();
733 testing::runPendingTasks(); 761 testing::runPendingTasks();
734 762
735 ASSERT_TRUE(isElementVisible(*mediaControls().timelineElement())); 763 ASSERT_TRUE(isElementVisible(*mediaControls().timelineElement()));
736 ClientRect* timelineRect = 764 ClientRect* timelineRect =
737 mediaControls().timelineElement()->getBoundingClientRect(); 765 mediaControls().timelineElement()->getBoundingClientRect();
738 ASSERT_LT(0, timelineRect->width()); 766 ASSERT_LT(0, timelineRect->width());
739 767
(...skipping 19 matching lines...) Expand all
759 "Media.Timeline.DragGestureDuration.128_255", 1); 787 "Media.Timeline.DragGestureDuration.128_255", 1);
760 histogramTester().expectUniqueSample("Media.Timeline.DragPercent.128_255", 788 histogramTester().expectUniqueSample("Media.Timeline.DragPercent.128_255",
761 8 /* (-35.0%, -30.0%] */, 1); 789 8 /* (-35.0%, -30.0%] */, 1);
762 histogramTester().expectUniqueSample( 790 histogramTester().expectUniqueSample(
763 "Media.Timeline.DragSumAbsTimeDelta.128_255", 17 /* [8m, 15m) */, 1); 791 "Media.Timeline.DragSumAbsTimeDelta.128_255", 17 /* [8m, 15m) */, 1);
764 histogramTester().expectUniqueSample("Media.Timeline.DragTimeDelta.128_255", 792 histogramTester().expectUniqueSample("Media.Timeline.DragTimeDelta.128_255",
765 9 /* (-4m, -2m] */, 1); 793 9 /* (-4m, -2m] */, 1);
766 } 794 }
767 795
768 } // namespace blink 796 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698