Chromium Code Reviews| Index: chrome/browser/about_flags_unittest.cc |
| diff --git a/chrome/browser/about_flags_unittest.cc b/chrome/browser/about_flags_unittest.cc |
| index 4251cffcec57e5c6dead1f20961b5d0a279441f2..c6c2092e91c76e912f88134529c1cceeb0ab3440 100644 |
| --- a/chrome/browser/about_flags_unittest.cc |
| +++ b/chrome/browser/about_flags_unittest.cc |
| @@ -221,6 +221,34 @@ TEST_F(AboutFlagsTest, ConvertFlagsToSwitches) { |
| EXPECT_TRUE(command_line.HasSwitch(kSwitch1)); |
| } |
| +TEST_F(AboutFlagsTest, CompareSwitchesToCurrentCommandLine) { |
| + SetExperimentEnabled(&prefs_, kFlags1, true); |
| + |
| + CommandLine command_line(CommandLine::NO_PROGRAM); |
| + command_line.AppendSwitch("foo"); |
| + |
| + CommandLine new_command_line(CommandLine::NO_PROGRAM); |
| + ConvertFlagsToSwitches(&prefs_, &new_command_line); |
| + |
| + EXPECT_FALSE(CompareSwitchesToCurrentCommandLine(new_command_line, |
| + command_line)); |
| + |
| + ConvertFlagsToSwitches(&prefs_, &command_line); |
| + |
| + EXPECT_TRUE(CompareSwitchesToCurrentCommandLine(new_command_line, |
| + command_line)); |
|
Mattias Nissler (ping if slow)
2013/06/13 16:55:57
nit: indentation.
pastarmovj
2013/06/13 17:29:36
Done.
|
| + |
| + // Now both have flags but different. |
| + SetExperimentEnabled(&prefs_, kFlags1, false); |
| + SetExperimentEnabled(&prefs_, kFlags2, true); |
| + |
| + CommandLine another_command_line(CommandLine::NO_PROGRAM); |
| + ConvertFlagsToSwitches(&prefs_, &another_command_line); |
| + |
| + EXPECT_FALSE(CompareSwitchesToCurrentCommandLine(new_command_line, |
| + another_command_line)); |
| +} |
| + |
| TEST_F(AboutFlagsTest, RemoveFlagSwitches) { |
| std::map<std::string, CommandLine::StringType> switch_list; |
| switch_list[kSwitch1] = CommandLine::StringType(); |