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

Side by Side Diff: ash/wm/maximize_mode/maximize_mode_controller_unittest.cc

Issue 2642853006: Remove the ash-enable-touch-view-testing flag (Closed)
Patch Set: Fix tests Created 3 years, 11 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ash/common/wm/maximize_mode/maximize_mode_controller.h" 5 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 kAccelerometerVerticalHingeUnstableAnglesTestData[i * 6 + 3], 534 kAccelerometerVerticalHingeUnstableAnglesTestData[i * 6 + 3],
535 kAccelerometerVerticalHingeUnstableAnglesTestData[i * 6 + 4], 535 kAccelerometerVerticalHingeUnstableAnglesTestData[i * 6 + 4],
536 kAccelerometerVerticalHingeUnstableAnglesTestData[i * 6 + 5]); 536 kAccelerometerVerticalHingeUnstableAnglesTestData[i * 6 + 5]);
537 TriggerBaseAndLidUpdate(base, lid); 537 TriggerBaseAndLidUpdate(base, lid);
538 // There are a lot of samples, so ASSERT rather than EXPECT to only generate 538 // There are a lot of samples, so ASSERT rather than EXPECT to only generate
539 // one failure rather than potentially hundreds. 539 // one failure rather than potentially hundreds.
540 ASSERT_TRUE(IsMaximizeModeStarted()); 540 ASSERT_TRUE(IsMaximizeModeStarted());
541 } 541 }
542 } 542 }
543 543
544 class MaximizeModeControllerSwitchesTest : public MaximizeModeControllerTest {
545 public:
546 MaximizeModeControllerSwitchesTest() {}
547 ~MaximizeModeControllerSwitchesTest() override {}
548
549 void SetUp() override {
550 base::CommandLine::ForCurrentProcess()->AppendSwitch(
551 switches::kAshEnableTouchViewTesting);
552 MaximizeModeControllerTest::SetUp();
553 }
554
555 private:
556 DISALLOW_COPY_AND_ASSIGN(MaximizeModeControllerSwitchesTest);
557 };
558
559 // Tests that when the command line switch for testing maximize mode is on, that
560 // accelerometer updates which would normally cause it to exit do not.
561 TEST_F(MaximizeModeControllerSwitchesTest, IgnoreHingeAngles) {
562 maximize_mode_controller()->EnableMaximizeModeWindowManager(true);
563
564 // Would normally trigger an exit from maximize mode.
565 OpenLidToAngle(90.0f);
566 EXPECT_TRUE(IsMaximizeModeStarted());
567 }
568
569 } // namespace ash 544 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698