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

Side by Side Diff: chrome/browser/extensions/activity_log/activity_log_browsertest.cc

Issue 2077723002: [Extensions] Short-circuit activity logging if not enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add Test 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 host_resolver()->AddRule("*", "127.0.0.1"); 70 host_resolver()->AddRule("*", "127.0.0.1");
71 ASSERT_TRUE(StartEmbeddedTestServer()); 71 ASSERT_TRUE(StartEmbeddedTestServer());
72 uint16_t port = embedded_test_server()->port(); 72 uint16_t port = embedded_test_server()->port();
73 73
74 // Get the extension (chrome/test/data/extensions/activity_log) 74 // Get the extension (chrome/test/data/extensions/activity_log)
75 const Extension* ext = 75 const Extension* ext =
76 LoadExtension(test_data_dir_.AppendASCII("activity_log")); 76 LoadExtension(test_data_dir_.AppendASCII("activity_log"));
77 ASSERT_TRUE(ext); 77 ASSERT_TRUE(ext);
78 78
79 ActivityLog* activity_log = ActivityLog::GetInstance(profile()); 79 ActivityLog* activity_log = ActivityLog::GetInstance(profile());
80 activity_log->SetWatchdogAppActiveForTesting(true);
80 ASSERT_TRUE(activity_log); 81 ASSERT_TRUE(activity_log);
81 82
82 // Disable rate limiting in PrerenderManager 83 // Disable rate limiting in PrerenderManager
83 prerender::PrerenderManager* prerender_manager = 84 prerender::PrerenderManager* prerender_manager =
84 prerender::PrerenderManagerFactory::GetForProfile(profile()); 85 prerender::PrerenderManagerFactory::GetForProfile(profile());
85 ASSERT_TRUE(prerender_manager); 86 ASSERT_TRUE(prerender_manager);
86 prerender_manager->mutable_config().rate_limit_enabled = false; 87 prerender_manager->mutable_config().rate_limit_enabled = false;
87 // Increase prerenderer limits, otherwise this test fails 88 // Increase prerenderer limits, otherwise this test fails
88 // on Windows XP. 89 // on Windows XP.
89 prerender_manager->mutable_config().max_bytes = 1000 * 1024 * 1024; 90 prerender_manager->mutable_config().max_bytes = 1000 * 1024 * 1024;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 "", 122 "",
122 -1, 123 -1,
123 base::Bind( 124 base::Bind(
124 ActivityLogPrerenderTest::Prerender_Arguments, ext->id(), port)); 125 ActivityLogPrerenderTest::Prerender_Arguments, ext->id(), port));
125 126
126 // Allow invocation of Prerender_Arguments 127 // Allow invocation of Prerender_Arguments
127 base::MessageLoop::current()->Run(); 128 base::MessageLoop::current()->Run();
128 } 129 }
129 130
130 } // namespace extensions 131 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698