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

Unified Diff: content/browser/tracing/background_tracing_manager_browsertest.cc

Issue 1417503006: Revert of Background tracing: Tracing scenarios can now enable/disable Blink features, for A/B testing purpos… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/tracing/background_tracing_manager_browsertest.cc
diff --git a/content/browser/tracing/background_tracing_manager_browsertest.cc b/content/browser/tracing/background_tracing_manager_browsertest.cc
index 44d82e78a058e70a65a90dbfa9289eb88b2a5628..1618a7d0dac10816cd6bb38abf3e273e0dbe6291 100644
--- a/content/browser/tracing/background_tracing_manager_browsertest.cc
+++ b/content/browser/tracing/background_tracing_manager_browsertest.cc
@@ -3,13 +3,11 @@
// found in the LICENSE file.
#include "base/bind.h"
-#include "base/command_line.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/pattern.h"
#include "base/trace_event/trace_event.h"
#include "content/browser/tracing/background_tracing_manager_impl.h"
#include "content/browser/tracing/background_tracing_rule.h"
-#include "content/public/common/content_switches.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/public/test/test_utils.h"
@@ -415,94 +413,6 @@
EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1);
}
-}
-
-// This tests that toggling Blink scenarios in the config alters the
-// command-line.
-IN_PROC_BROWSER_TEST_F(BackgroundTracingManagerBrowserTest,
- ToggleBlinkScenarios) {
- {
- SetupBackgroundTracingManager();
-
- base::RunLoop run_loop;
- BackgroundTracingManagerUploadConfigWrapper upload_config_wrapper(
- run_loop.QuitClosure());
-
- base::DictionaryValue dict;
- dict.SetString("mode", "PREEMPTIVE_TRACING_MODE");
- dict.SetString("category", "BENCHMARK");
-
- scoped_ptr<base::ListValue> rules_list(new base::ListValue());
- {
- scoped_ptr<base::DictionaryValue> rules_dict(new base::DictionaryValue());
- rules_dict->SetString("rule", "MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED");
- rules_dict->SetString("trigger_name", "test2");
- rules_list->Append(rules_dict.Pass());
- }
-
- dict.Set("configs", rules_list.Pass());
- dict.SetString("enable_blink_features", "FasterWeb1,FasterWeb2");
- dict.SetString("disable_blink_features", "SlowerWeb1,SlowerWeb2");
- scoped_ptr<BackgroundTracingConfig> config(
- BackgroundTracingConfigImpl::FromDict(&dict));
- EXPECT_TRUE(config);
-
- bool scenario_activated =
- BackgroundTracingManager::GetInstance()->SetActiveScenario(
- config.Pass(), upload_config_wrapper.get_receive_callback(),
- BackgroundTracingManager::NO_DATA_FILTERING);
-
- EXPECT_TRUE(scenario_activated);
-
- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- EXPECT_TRUE(command_line);
-
- EXPECT_EQ(command_line->GetSwitchValueASCII(switches::kEnableBlinkFeatures),
- "FasterWeb1,FasterWeb2");
- EXPECT_EQ(
- command_line->GetSwitchValueASCII(switches::kDisableBlinkFeatures),
- "SlowerWeb1,SlowerWeb2");
- }
-}
-
-// This tests that toggling Blink scenarios in a scenario won't activate
-// if there's already Blink features toggled by something else (about://flags)
-IN_PROC_BROWSER_TEST_F(BackgroundTracingManagerBrowserTest,
- ToggleBlinkScenariosNotOverridingSwitches) {
- SetupBackgroundTracingManager();
-
- base::RunLoop run_loop;
- BackgroundTracingManagerUploadConfigWrapper upload_config_wrapper(
- run_loop.QuitClosure());
-
- base::DictionaryValue dict;
- dict.SetString("mode", "PREEMPTIVE_TRACING_MODE");
- dict.SetString("category", "BENCHMARK");
-
- scoped_ptr<base::ListValue> rules_list(new base::ListValue());
- {
- scoped_ptr<base::DictionaryValue> rules_dict(new base::DictionaryValue());
- rules_dict->SetString("rule", "MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED");
- rules_dict->SetString("trigger_name", "test2");
- rules_list->Append(rules_dict.Pass());
- }
-
- dict.Set("configs", rules_list.Pass());
- dict.SetString("enable_blink_features", "FasterWeb1,FasterWeb2");
- dict.SetString("disable_blink_features", "SlowerWeb1,SlowerWeb2");
- scoped_ptr<BackgroundTracingConfig> config(
- BackgroundTracingConfigImpl::FromDict(&dict));
- EXPECT_TRUE(config);
-
- base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kEnableBlinkFeatures, "FooFeature");
-
- bool scenario_activated =
- BackgroundTracingManager::GetInstance()->SetActiveScenario(
- config.Pass(), upload_config_wrapper.get_receive_callback(),
- BackgroundTracingManager::NO_DATA_FILTERING);
-
- EXPECT_FALSE(scenario_activated);
}
// This tests that delayed histogram triggers triggers work as expected

Powered by Google App Engine
This is Rietveld 408576698