forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chromecast] Add cast_shell --accept-resource-provider switch and a u…
…tility function, GetSwitchValueBoolean. Also has the cast_shell flag --accept-resource-provider imply --alsa-check-close-timeout=0 unless the close timeout is explicitly overridden. BUG=internal b/26091363 TEST=pepperoni build cast_base_unittests --gtest_filter=ChromecastSwitchesTest.* Review URL: https://codereview.chromium.org/1767603003 Cr-Commit-Position: refs/heads/master@{#380024}
- Loading branch information
jyw
authored and
Commit bot
committed
Mar 9, 2016
1 parent
c13b8c0
commit b92b0b2
Showing
6 changed files
with
129 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright 2016 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "base/command_line.h" | ||
#include "chromecast/base/chromecast_switches.h" | ||
#include "testing/gtest/include/gtest/gtest.h" | ||
|
||
namespace chromecast { | ||
|
||
TEST(ChromecastSwitchesTest, NoSwitch) { | ||
if (base::CommandLine::CommandLine::InitializedForCurrentProcess()) | ||
base::CommandLine::Reset(); | ||
base::CommandLine::Init(0, nullptr); | ||
EXPECT_TRUE(GetSwitchValueBoolean(switches::kEnableCmaMediaPipeline, true)); | ||
EXPECT_FALSE(GetSwitchValueBoolean(switches::kEnableCmaMediaPipeline, false)); | ||
} | ||
|
||
TEST(ChromecastSwitchesTest, NoSwitchValue) { | ||
if (base::CommandLine::CommandLine::InitializedForCurrentProcess()) | ||
base::CommandLine::Reset(); | ||
base::CommandLine::Init(0, nullptr); | ||
base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); | ||
cl->AppendSwitch(switches::kEnableCmaMediaPipeline); | ||
EXPECT_TRUE(GetSwitchValueBoolean(switches::kEnableCmaMediaPipeline, true)); | ||
EXPECT_TRUE(GetSwitchValueBoolean(switches::kEnableCmaMediaPipeline, false)); | ||
} | ||
|
||
TEST(ChromecastSwitchesTest, SwitchValueTrue) { | ||
if (base::CommandLine::CommandLine::InitializedForCurrentProcess()) | ||
base::CommandLine::Reset(); | ||
base::CommandLine::Init(0, nullptr); | ||
base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); | ||
cl->AppendSwitchASCII(switches::kEnableCmaMediaPipeline, | ||
switches::kSwitchValueTrue); | ||
EXPECT_TRUE(GetSwitchValueBoolean(switches::kEnableCmaMediaPipeline, true)); | ||
EXPECT_TRUE(GetSwitchValueBoolean(switches::kEnableCmaMediaPipeline, false)); | ||
} | ||
|
||
TEST(ChromecastSwitchesTest, SwitchValueFalse) { | ||
if (base::CommandLine::CommandLine::InitializedForCurrentProcess()) | ||
base::CommandLine::Reset(); | ||
base::CommandLine::Init(0, nullptr); | ||
base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); | ||
cl->AppendSwitchASCII(switches::kEnableCmaMediaPipeline, | ||
switches::kSwitchValueFalse); | ||
EXPECT_FALSE(GetSwitchValueBoolean(switches::kEnableCmaMediaPipeline, true)); | ||
EXPECT_FALSE(GetSwitchValueBoolean(switches::kEnableCmaMediaPipeline, false)); | ||
} | ||
|
||
TEST(ChromecastSwitchesTest, SwitchValueNonsense) { | ||
if (base::CommandLine::CommandLine::InitializedForCurrentProcess()) | ||
base::CommandLine::Reset(); | ||
base::CommandLine::Init(0, nullptr); | ||
base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); | ||
cl->AppendSwitchASCII(switches::kEnableCmaMediaPipeline, "silverware"); | ||
EXPECT_TRUE(GetSwitchValueBoolean(switches::kEnableCmaMediaPipeline, true)); | ||
EXPECT_FALSE(GetSwitchValueBoolean(switches::kEnableCmaMediaPipeline, false)); | ||
} | ||
|
||
} // namespace chromecast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters