diff options
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/automation/automation_proxy.cc | 4 | ||||
-rw-r--r-- | chrome/test/automation/automation_proxy.h | 16 | ||||
-rw-r--r-- | chrome/test/base/tracing.cc | 17 | ||||
-rw-r--r-- | chrome/test/base/tracing.h | 15 | ||||
-rw-r--r-- | chrome/test/gpu/gpu_feature_browsertest.cc | 12 | ||||
-rw-r--r-- | chrome/test/pyautolib/pyautolib.i | 5 | ||||
-rw-r--r-- | chrome/test/ui/ui_test.cc | 4 | ||||
-rw-r--r-- | chrome/test/ui/ui_test.h | 2 |
8 files changed, 40 insertions, 35 deletions
diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc index 8a0ed36..37e173c 100644 --- a/chrome/test/automation/automation_proxy.cc +++ b/chrome/test/automation/automation_proxy.cc @@ -404,9 +404,9 @@ void AutomationProxy::ResetChannel() { tracker_->put_channel(NULL); } -bool AutomationProxy::BeginTracing(const std::string& categories) { +bool AutomationProxy::BeginTracing(const std::string& category_patterns) { bool result = false; - bool send_success = Send(new AutomationMsg_BeginTracing(categories, + bool send_success = Send(new AutomationMsg_BeginTracing(category_patterns, &result)); return send_success && result; } diff --git a/chrome/test/automation/automation_proxy.h b/chrome/test/automation/automation_proxy.h index 788a3dc..3dfb7f1 100644 --- a/chrome/test/automation/automation_proxy.h +++ b/chrome/test/automation/automation_proxy.h @@ -153,19 +153,21 @@ class AutomationProxy : public IPC::Listener, public AutomationMessageSender { int timeout_ms, std::string* response) WARN_UNUSED_RESULT; - // Begin tracing specified categories on the browser instance. Blocks until - // browser acknowledges that tracing has begun (or failed if false is - // returned). |categories| is a comma-delimited list of category wildcards. - // A category can have an optional '-' prefix to make it an excluded category. - // Either all categories must be included or all must be excluded. + // Begin tracing specified category_patterns on the browser instance. Blocks + // until browser acknowledges that tracing has begun (or failed if false is + // returned). |category_patterns| is a comma-delimited list of category + // wildcards. + // A category pattern can have an optional '-' prefix to exclude category + // groups that contain matching category. + // Either all category_patterns must be included or all must be excluded. // // Example: BeginTracing("test_MyTest*"); // Example: BeginTracing("test_MyTest*,test_OtherStuff"); // Example: BeginTracing("-excluded_category1,-excluded_category2"); // // See base/event_trace.h for documentation of included and excluded - // categories. - bool BeginTracing(const std::string& categories) WARN_UNUSED_RESULT; + // category_patterns. + bool BeginTracing(const std::string& category_patterns) WARN_UNUSED_RESULT; // End trace and collect the trace output as a json string. bool EndTracing(std::string* json_trace_output) WARN_UNUSED_RESULT; diff --git a/chrome/test/base/tracing.cc b/chrome/test/base/tracing.cc index b3a28d0..91fb7c2 100644 --- a/chrome/test/base/tracing.cc +++ b/chrome/test/base/tracing.cc @@ -27,20 +27,20 @@ class InProcessTraceController : public content::TraceSubscriber { watch_notification_count_(0) {} virtual ~InProcessTraceController() {} - bool BeginTracing(const std::string& categories) { + bool BeginTracing(const std::string& category_patterns) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); return content::TraceController::GetInstance()->BeginTracing( - this, categories, base::debug::TraceLog::RECORD_UNTIL_FULL); + this, category_patterns, base::debug::TraceLog::RECORD_UNTIL_FULL); } - bool BeginTracingWithWatch(const std::string& categories, + bool BeginTracingWithWatch(const std::string& category_patterns, const std::string& category_name, const std::string& event_name, int num_occurrences) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(num_occurrences > 0); watch_notification_count_ = num_occurrences; - return BeginTracing(categories) && + return BeginTracing(category_patterns) && content::TraceController::GetInstance()->SetWatchEvent( this, category_name, event_name); } @@ -135,16 +135,17 @@ class InProcessTraceController : public content::TraceSubscriber { namespace tracing { -bool BeginTracing(const std::string& categories) { - return InProcessTraceController::GetInstance()->BeginTracing(categories); +bool BeginTracing(const std::string& category_patterns) { + return InProcessTraceController::GetInstance()->BeginTracing( + category_patterns); } -bool BeginTracingWithWatch(const std::string& categories, +bool BeginTracingWithWatch(const std::string& category_patterns, const std::string& category_name, const std::string& event_name, int num_occurrences) { return InProcessTraceController::GetInstance()->BeginTracingWithWatch( - categories, category_name, event_name, num_occurrences); + category_patterns, category_name, event_name, num_occurrences); } bool WaitForWatchEvent(base::TimeDelta timeout) { diff --git a/chrome/test/base/tracing.h b/chrome/test/base/tracing.h index 15dffc7..0dd21b8 100644 --- a/chrome/test/base/tracing.h +++ b/chrome/test/base/tracing.h @@ -13,24 +13,25 @@ namespace tracing { // Called from UI thread. -// Begin tracing specified categories on the browser. -// |categories| is a comma-delimited list of category wildcards. A category can -// have an optional '-' prefix to make it an excluded category. Either all -// categories must be included or all must be excluded. +// Begin tracing specified category_patterns on the browser. +// |category_patterns| is a comma-delimited list of category wildcards. +// A category pattern can have an optional '-' prefix to make categories with +// matching categorys excluded. Either all category_patterns must be included +// or all must be excluded. // // Example: BeginTracing("test_MyTest*"); // Example: BeginTracing("test_MyTest*,test_OtherStuff"); // Example: BeginTracing("-excluded_category1,-excluded_category2"); // // See base/debug/trace_event.h for documentation of included and excluded -// categories. -bool BeginTracing(const std::string& categories) WARN_UNUSED_RESULT; +// category_patterns. +bool BeginTracing(const std::string& category_patterns) WARN_UNUSED_RESULT; // Called from UI thread. // Specify a watch event in order to use the WaitForWatchEvent function. // After |num_occurrences| of the given event have been seen on a particular // process, WaitForWatchEvent will return. -bool BeginTracingWithWatch(const std::string& categories, +bool BeginTracingWithWatch(const std::string& category_patterns, const std::string& category_name, const std::string& event_name, int num_occurrences) WARN_UNUSED_RESULT; diff --git a/chrome/test/gpu/gpu_feature_browsertest.cc b/chrome/test/gpu/gpu_feature_browsertest.cc index cdcfe6a..e222d60 100644 --- a/chrome/test/gpu/gpu_feature_browsertest.cc +++ b/chrome/test/gpu/gpu_feature_browsertest.cc @@ -48,7 +48,7 @@ const char kWebGLCreationEvent[] = "DrawingBufferCreation"; class GpuFeatureTest : public InProcessBrowserTest { public: - GpuFeatureTest() : trace_categories_("test_gpu"), gpu_enabled_(false) {} + GpuFeatureTest() : category_patterns_("test_gpu"), gpu_enabled_(false) {} virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { base::FilePath test_dir; @@ -125,7 +125,7 @@ class GpuFeatureTest : public InProcessBrowserTest { return; #endif - ASSERT_TRUE(tracing::BeginTracing(trace_categories_)); + ASSERT_TRUE(tracing::BeginTracing(category_patterns_)); // Have to use a new tab for the blacklist to work. RunTest(url, NULL, true); @@ -151,10 +151,10 @@ class GpuFeatureTest : public InProcessBrowserTest { // Trigger a resize of the chrome window, and use tracing to wait for the // given |wait_event|. bool ResizeAndWait(const gfx::Rect& new_bounds, - const char* trace_categories, + const char* category_patterns, const char* wait_category, const char* wait_event) { - if (!tracing::BeginTracingWithWatch(trace_categories, wait_category, + if (!tracing::BeginTracingWithWatch(category_patterns, wait_category, wait_event, 1)) return false; browser()->window()->SetBounds(new_bounds); @@ -170,7 +170,7 @@ class GpuFeatureTest : public InProcessBrowserTest { protected: base::FilePath gpu_test_dir_; scoped_ptr<TraceAnalyzer> analyzer_; - std::string trace_categories_; + std::string category_patterns_; std::string trace_events_json_; bool gpu_enabled_; }; @@ -449,7 +449,7 @@ IN_PROC_BROWSER_TEST_F(ThreadedCompositorTest, DISABLED_ThreadedCompositor) { #define MAYBE_RafNoDamage RafNoDamage #endif IN_PROC_BROWSER_TEST_F(GpuFeatureTest, MAYBE_RafNoDamage) { - trace_categories_ = "-test_*"; + category_patterns_ = "-test_*"; const base::FilePath url(FILE_PATH_LITERAL("feature_raf_no_damage.html")); RunEventTest(url); diff --git a/chrome/test/pyautolib/pyautolib.i b/chrome/test/pyautolib/pyautolib.i index 6f17123..9e94f50 100644 --- a/chrome/test/pyautolib/pyautolib.i +++ b/chrome/test/pyautolib/pyautolib.i @@ -130,9 +130,10 @@ class PyUITestBase { void AppendBrowserLaunchSwitch(const char* name); void AppendBrowserLaunchSwitch(const char* name, const char* value); - %feature("docstring", "Begins tracing with the given category string.") + %feature("docstring", "Begins tracing with the given category_patterns " + "string.") BeginTracing; - bool BeginTracing(const std::string& categories); + bool BeginTracing(const std::string& category_patterns); %feature("docstring", "Ends tracing and returns the collected events.") EndTracing; diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index 40bdf16..4a409ac 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -509,8 +509,8 @@ void UITestBase::AppendBrowserLaunchSwitch(const char* name, launch_arguments_.AppendSwitchASCII(name, value); } -bool UITestBase::BeginTracing(const std::string& categories) { - return automation()->BeginTracing(categories); +bool UITestBase::BeginTracing(const std::string& category_patterns) { + return automation()->BeginTracing(category_patterns); } std::string UITestBase::EndTracing() { diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h index ade8dfb..981b15e 100644 --- a/chrome/test/ui/ui_test.h +++ b/chrome/test/ui/ui_test.h @@ -237,7 +237,7 @@ class UITestBase { void AppendBrowserLaunchSwitch(const char* name, const char* value); // Pass-through to AutomationProxy::BeginTracing. - bool BeginTracing(const std::string& categories); + bool BeginTracing(const std::string& category_patterns); // Pass-through to AutomationProxy::EndTracing. std::string EndTracing(); |