Commit cd7fa99f authored by thakis@chromium.org's avatar thakis@chromium.org

Revert 99883 - Completely disable about:flags

This is an attempt to improve stability on the m14 branch. I will revert this CL right after merging it to m14.

BUG=95592
TEST=Go to about:flags and chrome://flags. Nothing should be there.
Go to about:version, no --begin-flags and --end-flags should be there.

Review URL: http://codereview.chromium.org/7837006

TBR=thakis@chromium.org
Review URL: http://codereview.chromium.org/7841022

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99888 0039d316-1c4b-4281-b951-d872f2087c98
parent 14256d3c
...@@ -697,10 +697,7 @@ void FlagsState::ConvertFlagsToSwitches( ...@@ -697,10 +697,7 @@ void FlagsState::ConvertFlagsToSwitches(
} }
} }
// TODO(thakis): Reenable.
#if 0
command_line->AppendSwitch(switches::kFlagSwitchesBegin); command_line->AppendSwitch(switches::kFlagSwitchesBegin);
#endif
flags_switches_.insert( flags_switches_.insert(
std::pair<std::string, std::string>(switches::kFlagSwitchesBegin, std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
std::string())); std::string()));
...@@ -718,17 +715,11 @@ void FlagsState::ConvertFlagsToSwitches( ...@@ -718,17 +715,11 @@ void FlagsState::ConvertFlagsToSwitches(
const std::pair<std::string, std::string>& const std::pair<std::string, std::string>&
switch_and_value_pair = name_to_switch_it->second; switch_and_value_pair = name_to_switch_it->second;
// TODO(thakis): Reenable.
#if 0
command_line->AppendSwitchASCII(switch_and_value_pair.first, command_line->AppendSwitchASCII(switch_and_value_pair.first,
switch_and_value_pair.second); switch_and_value_pair.second);
#endif
flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second; flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
} }
// TODO(thakis): Reenable.
#if 0
command_line->AppendSwitch(switches::kFlagSwitchesEnd); command_line->AppendSwitch(switches::kFlagSwitchesEnd);
#endif
flags_switches_.insert( flags_switches_.insert(
std::pair<std::string, std::string>(switches::kFlagSwitchesEnd, std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
std::string())); std::string()));
......
...@@ -183,8 +183,7 @@ TEST_F(AboutFlagsTest, ConvertFlagsToSwitches) { ...@@ -183,8 +183,7 @@ TEST_F(AboutFlagsTest, ConvertFlagsToSwitches) {
ConvertFlagsToSwitches(&prefs_, &command_line); ConvertFlagsToSwitches(&prefs_, &command_line);
EXPECT_TRUE(command_line.HasSwitch("foo")); EXPECT_TRUE(command_line.HasSwitch("foo"));
// TODO(thakis): Undo EXPECT_TRUE(command_line.HasSwitch(kSwitch1));
EXPECT_FALSE(command_line.HasSwitch(kSwitch1));
} }
TEST_F(AboutFlagsTest, RemoveFlagSwitches) { TEST_F(AboutFlagsTest, RemoveFlagSwitches) {
...@@ -229,8 +228,7 @@ TEST_F(AboutFlagsTest, PersistAndPrune) { ...@@ -229,8 +228,7 @@ TEST_F(AboutFlagsTest, PersistAndPrune) {
// Convert the flags to switches. Experiment 3 shouldn't be among the switches // Convert the flags to switches. Experiment 3 shouldn't be among the switches
// as it is not applicable to the current platform. // as it is not applicable to the current platform.
ConvertFlagsToSwitches(&prefs_, &command_line); ConvertFlagsToSwitches(&prefs_, &command_line);
// TODO(thakis): undo. EXPECT_TRUE(command_line.HasSwitch(kSwitch1));
EXPECT_FALSE(command_line.HasSwitch(kSwitch1));
EXPECT_FALSE(command_line.HasSwitch(kSwitch3)); EXPECT_FALSE(command_line.HasSwitch(kSwitch3));
// Experiment 3 should show still be persisted in preferences though. // Experiment 3 should show still be persisted in preferences though.
...@@ -246,18 +244,15 @@ TEST_F(AboutFlagsTest, CheckValues) { ...@@ -246,18 +244,15 @@ TEST_F(AboutFlagsTest, CheckValues) {
SetExperimentEnabled(&prefs_, kFlags1, true); SetExperimentEnabled(&prefs_, kFlags1, true);
SetExperimentEnabled(&prefs_, kFlags2, true); SetExperimentEnabled(&prefs_, kFlags2, true);
CommandLine command_line(CommandLine::NO_PROGRAM); CommandLine command_line(CommandLine::NO_PROGRAM);
// TODO(thakis): undo.
EXPECT_FALSE(command_line.HasSwitch(kSwitch1)); EXPECT_FALSE(command_line.HasSwitch(kSwitch1));
EXPECT_FALSE(command_line.HasSwitch(kSwitch2)); EXPECT_FALSE(command_line.HasSwitch(kSwitch2));
// Convert the flags to switches. // Convert the flags to switches.
ConvertFlagsToSwitches(&prefs_, &command_line); ConvertFlagsToSwitches(&prefs_, &command_line);
EXPECT_FALSE(command_line.HasSwitch(kSwitch1)); EXPECT_TRUE(command_line.HasSwitch(kSwitch1));
EXPECT_EQ(std::string(""), command_line.GetSwitchValueASCII(kSwitch1)); EXPECT_EQ(std::string(""), command_line.GetSwitchValueASCII(kSwitch1));
// TODO(thakis): undo. EXPECT_TRUE(command_line.HasSwitch(kSwitch2));
EXPECT_FALSE(command_line.HasSwitch(kSwitch2)); EXPECT_EQ(std::string(kValueForSwitch2),
// TODO(thakis): undo.
EXPECT_EQ("",
command_line.GetSwitchValueASCII(kSwitch2)); command_line.GetSwitchValueASCII(kSwitch2));
// Confirm that there is no '=' in the command line for simple switches. // Confirm that there is no '=' in the command line for simple switches.
...@@ -278,13 +273,11 @@ TEST_F(AboutFlagsTest, CheckValues) { ...@@ -278,13 +273,11 @@ TEST_F(AboutFlagsTest, CheckValues) {
std::string(kSwitch2) + std::string(kSwitch2) +
std::string("="); std::string("=");
#if defined(OS_WIN) #if defined(OS_WIN)
// TODO(thakis): undo. EXPECT_NE(std::wstring::npos,
EXPECT_EQ(std::wstring::npos,
command_line.GetCommandLineString().find( command_line.GetCommandLineString().find(
ASCIIToWide(switch2_with_equals))); ASCIIToWide(switch2_with_equals)));
#else #else
// TODO(thakis): undo. EXPECT_NE(std::string::npos,
EXPECT_EQ(std::string::npos,
command_line.GetCommandLineString().find(switch2_with_equals)); command_line.GetCommandLineString().find(switch2_with_equals));
#endif #endif
...@@ -313,10 +306,8 @@ TEST_F(AboutFlagsTest, MultiValues) { ...@@ -313,10 +306,8 @@ TEST_F(AboutFlagsTest, MultiValues) {
CommandLine command_line(CommandLine::NO_PROGRAM); CommandLine command_line(CommandLine::NO_PROGRAM);
ConvertFlagsToSwitches(&prefs_, &command_line); ConvertFlagsToSwitches(&prefs_, &command_line);
EXPECT_FALSE(command_line.HasSwitch(kMultiSwitch1)); EXPECT_FALSE(command_line.HasSwitch(kMultiSwitch1));
// TODO(thakis): undo. EXPECT_TRUE(command_line.HasSwitch(kMultiSwitch2));
EXPECT_FALSE(command_line.HasSwitch(kMultiSwitch2)); EXPECT_EQ(std::string(kValueForMultiSwitch2),
// TODO(thakis): undo.
EXPECT_EQ("",
command_line.GetSwitchValueASCII(kMultiSwitch2)); command_line.GetSwitchValueASCII(kMultiSwitch2));
} }
......
...@@ -131,7 +131,7 @@ TEST_F(BuiltinProviderTest, NonChromeURLs) { ...@@ -131,7 +131,7 @@ TEST_F(BuiltinProviderTest, NonChromeURLs) {
&AutocompleteMatch::destination_url); &AutocompleteMatch::destination_url);
} }
TEST_F(BuiltinProviderTest, DISABLED_ChromeURLs) { TEST_F(BuiltinProviderTest, ChromeURLs) {
const string16 kAbout = ASCIIToUTF16(chrome::kAboutScheme); const string16 kAbout = ASCIIToUTF16(chrome::kAboutScheme);
const string16 kChrome = ASCIIToUTF16(chrome::kChromeUIScheme); const string16 kChrome = ASCIIToUTF16(chrome::kChromeUIScheme);
const string16 kSeparator1 = ASCIIToUTF16(":"); const string16 kSeparator1 = ASCIIToUTF16(":");
......
...@@ -120,8 +120,7 @@ const char* const kChromePaths[] = { ...@@ -120,8 +120,7 @@ const char* const kChromePaths[] = {
chrome::kChromeUIDNSHost, chrome::kChromeUIDNSHost,
chrome::kChromeUIDownloadsHost, chrome::kChromeUIDownloadsHost,
chrome::kChromeUIExtensionsHost, chrome::kChromeUIExtensionsHost,
// TODO(thakis): Reenable. chrome::kChromeUIFlagsHost,
//chrome::kChromeUIFlagsHost,
chrome::kChromeUIFlashHost, chrome::kChromeUIFlashHost,
chrome::kChromeUIGpuInternalsHost, chrome::kChromeUIGpuInternalsHost,
chrome::kChromeUIHistogramsHost, chrome::kChromeUIHistogramsHost,
......
...@@ -180,9 +180,8 @@ static WebUIFactoryFunction GetWebUIFactoryFunction(Profile* profile, ...@@ -180,9 +180,8 @@ static WebUIFactoryFunction GetWebUIFactoryFunction(Profile* profile,
return &NewWebUI<HistoryUI>; return &NewWebUI<HistoryUI>;
if (url.host() == chrome::kChromeUIHistory2Host) if (url.host() == chrome::kChromeUIHistory2Host)
return &NewWebUI<HistoryUI2>; return &NewWebUI<HistoryUI2>;
// TODO(thakis): Reenable. if (url.host() == chrome::kChromeUIFlagsHost)
//if (url.host() == chrome::kChromeUIFlagsHost) return &NewWebUI<FlagsUI>;
// return &NewWebUI<FlagsUI>;
if (url.host() == chrome::kChromeUIFlashHost) if (url.host() == chrome::kChromeUIFlashHost)
return &NewWebUI<FlashUI>; return &NewWebUI<FlashUI>;
#if defined(TOUCH_UI) #if defined(TOUCH_UI)
...@@ -388,9 +387,8 @@ RefCountedMemory* ChromeWebUIFactory::GetFaviconResourceBytes( ...@@ -388,9 +387,8 @@ RefCountedMemory* ChromeWebUIFactory::GetFaviconResourceBytes(
if (page_url.host() == chrome::kChromeUIHistory2Host) if (page_url.host() == chrome::kChromeUIHistory2Host)
return HistoryUI2::GetFaviconResourceBytes(); return HistoryUI2::GetFaviconResourceBytes();
// TODO(thakis): Reenable. if (page_url.host() == chrome::kChromeUIFlagsHost)
//if (page_url.host() == chrome::kChromeUIFlagsHost) return FlagsUI::GetFaviconResourceBytes();
// return FlagsUI::GetFaviconResourceBytes();
if (page_url.host() == chrome::kChromeUISessionsHost) if (page_url.host() == chrome::kChromeUISessionsHost)
return SessionsUI::GetFaviconResourceBytes(); return SessionsUI::GetFaviconResourceBytes();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment