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

Unified Diff: chrome/test/base/tracing_browsertest.cc

Issue 2058973002: testing Base URL: https://chromium.googlesource.com/chromium/src.git@set_whitelist
Patch Set: rebase. Created 4 years, 6 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
« no previous file with comments | « chrome/test/base/tracing.cc ('k') | content/child/child_discardable_shared_memory_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/tracing_browsertest.cc
diff --git a/chrome/test/base/tracing_browsertest.cc b/chrome/test/base/tracing_browsertest.cc
index dfd735628cc9978ee7af2bf21064df37043b8ba3..646dc25233dd1d606960977e95c9d3860ace0986 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::BeginTracing;
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(BeginTracing(trace_config));
// Create and destroy renderers while tracing is enabled.
GURL url2("chrome://credits");
@@ -165,7 +166,9 @@ IN_PROC_BROWSER_TEST_F(TracingBrowserTest, BeginTracingWithWatch) {
// Multi-process mode.
IN_PROC_BROWSER_TEST_F(TracingBrowserTest, TestMemoryInfra) {
- PerformDumpMemoryTestActions();
+ PerformDumpMemoryTestActions(base::trace_event::TraceConfig(
+ base::trace_event::TraceConfigMemoryTestUtil::
+ GetTraceConfig_PeriodicTriggers(250, 2000)));
}
// Single-process mode.
@@ -176,7 +179,22 @@ IN_PROC_BROWSER_TEST_F(TracingBrowserTest, TestMemoryInfra) {
#define MAYBE_TestMemoryInfra TestMemoryInfra
#endif
IN_PROC_BROWSER_TEST_F(SingleProcessTracingBrowserTest, MAYBE_TestMemoryInfra) {
- PerformDumpMemoryTestActions();
+ PerformDumpMemoryTestActions(base::trace_event::TraceConfig(
+ base::trace_event::TraceConfigMemoryTestUtil::
+ GetTraceConfig_PeriodicTriggers(250, 2000)));
+}
+
+IN_PROC_BROWSER_TEST_F(TracingBrowserTest, TestBackgroundMemoryInfra) {
+ PerformDumpMemoryTestActions(base::trace_event::TraceConfig(
+ base::trace_event::TraceConfigMemoryTestUtil::
+ GetTraceConfig_BackgroundTrigger(200)));
+}
+
+IN_PROC_BROWSER_TEST_F(SingleProcessTracingBrowserTest,
+ TestBackgroundMemoryInfra) {
+ PerformDumpMemoryTestActions(base::trace_event::TraceConfig(
+ base::trace_event::TraceConfigMemoryTestUtil::
+ GetTraceConfig_BackgroundTrigger(200)));
}
} // namespace
« no previous file with comments | « chrome/test/base/tracing.cc ('k') | content/child/child_discardable_shared_memory_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698