Index: chrome/test/base/tracing_browsertest.cc |
diff --git a/chrome/test/base/tracing_browsertest.cc b/chrome/test/base/tracing_browsertest.cc |
index 656f7577fc1c8f12a51bbe673d75fea29ad22ed1..97a5581df01402404d634ee28d5f00ee146d61d4 100644 |
--- a/chrome/test/base/tracing_browsertest.cc |
+++ b/chrome/test/base/tracing_browsertest.cc |
@@ -10,6 +10,7 @@ |
#include "base/single_thread_task_runner.h" |
#include "base/threading/thread_task_runner_handle.h" |
#include "base/trace_event/memory_dump_manager.h" |
+#include "base/trace_event/trace_config_memory_test_util.h" |
#include "base/trace_event/trace_event.h" |
#include "chrome/browser/ui/browser.h" |
#include "chrome/browser/ui/tabs/tab_strip_model.h" |
@@ -25,6 +26,7 @@ namespace { |
using base::trace_event::MemoryDumpManager; |
using base::trace_event::MemoryDumpType; |
+using tracing::BeginTracingWithTraceConfig; |
using tracing::BeginTracingWithWatch; |
using tracing::WaitForWatchEvent; |
using tracing::EndTracing; |
@@ -44,7 +46,8 @@ class TracingBrowserTest : public InProcessBrowserTest { |
ASSERT_TRUE(content::ExecuteScript(rvh, ";")); |
} |
- void PerformDumpMemoryTestActions() { |
+ void PerformDumpMemoryTestActions( |
+ const base::trace_event::TraceConfig& trace_config) { |
std::string json_events; |
base::TimeDelta no_timeout; |
@@ -57,9 +60,7 @@ class TracingBrowserTest : public InProcessBrowserTest { |
// Begin tracing and watch for multiple periodic dump trace events. |
std::string event_name = base::trace_event::MemoryDumpTypeToString( |
MemoryDumpType::PERIODIC_INTERVAL); |
- ASSERT_TRUE(BeginTracingWithWatch(MemoryDumpManager::kTraceCategory, |
- MemoryDumpManager::kTraceCategory, |
- event_name, 10)); |
+ ASSERT_TRUE(BeginTracingWithTraceConfig(trace_config)); |
// Create and destroy renderers while tracing is enabled. |
GURL url2("chrome://credits"); |
@@ -88,14 +89,6 @@ class TracingBrowserTest : public InProcessBrowserTest { |
} |
}; |
-class SingleProcessTracingBrowserTest : public TracingBrowserTest { |
- protected: |
- void SetUpCommandLine(base::CommandLine* command_line) override { |
- InProcessBrowserTest::SetUpCommandLine(command_line); |
- command_line->AppendSwitch(switches::kSingleProcess); |
- } |
-}; |
- |
void AddEvents(int num) { |
for (int i = 0; i < num; ++i) |
TRACE_EVENT_INSTANT0(g_category, g_event, TRACE_EVENT_SCOPE_THREAD); |
@@ -163,21 +156,16 @@ IN_PROC_BROWSER_TEST_F(TracingBrowserTest, BeginTracingWithWatch) { |
ASSERT_TRUE(EndTracing(&json_events)); |
} |
-// Multi-process mode. |
IN_PROC_BROWSER_TEST_F(TracingBrowserTest, TestMemoryInfra) { |
- PerformDumpMemoryTestActions(); |
+ PerformDumpMemoryTestActions(base::trace_event::TraceConfig( |
+ base::trace_event::TraceConfigMemoryTestUtil:: |
+ GetTraceConfig_PeriodicTriggers(250, 2000))); |
Primiano Tucci (use gerrit)
2016/06/16 13:32:30
aren't this value going to make this test too slow
ssid
2016/06/16 21:42:21
These were the existing values (when enabled just
|
} |
-// Single-process mode. |
-// Linux ASan: https://crbug.com/585026. |
-// Linux https://crbug/619515. |
-#if defined(ADDRESS_SANITIZER) || defined(OS_LINUX) |
-#define MAYBE_TestMemoryInfra DISABLED_TestMemoryInfra |
-#else |
-#define MAYBE_TestMemoryInfra TestMemoryInfra |
-#endif |
-IN_PROC_BROWSER_TEST_F(SingleProcessTracingBrowserTest, MAYBE_TestMemoryInfra) { |
- PerformDumpMemoryTestActions(); |
+IN_PROC_BROWSER_TEST_F(TracingBrowserTest, TestBackgroundMemoryInfra) { |
+ PerformDumpMemoryTestActions(base::trace_event::TraceConfig( |
+ base::trace_event::TraceConfigMemoryTestUtil:: |
+ GetTraceConfig_BackgroundTrigger(200))); |
} |
} // namespace |