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

Side by Side Diff: chrome/browser/extensions/api/activity_log_private/activity_log_private_apitest.cc

Issue 2393343002: Split ExtensionTestObserver and move to //extensions. (Closed)
Patch Set: fix bug in ActivityLogApiTest.TriggerEvent Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 <string> 5 #include <string>
6 #include <utility> 6 #include <utility>
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/browser/extensions/activity_log/activity_log.h" 9 #include "chrome/browser/extensions/activity_log/activity_log.h"
10 #include "chrome/browser/extensions/extension_apitest.h" 10 #include "chrome/browser/extensions/extension_apitest.h"
(...skipping 12 matching lines...) Expand all
23 using net::test_server::HttpResponse; 23 using net::test_server::HttpResponse;
24 using net::test_server::HttpRequest; 24 using net::test_server::HttpRequest;
25 25
26 namespace extensions { 26 namespace extensions {
27 27
28 class ActivityLogApiTest : public ExtensionApiTest { 28 class ActivityLogApiTest : public ExtensionApiTest {
29 public: 29 public:
30 ActivityLogApiTest() : saved_cmdline_(base::CommandLine::NO_PROGRAM) {} 30 ActivityLogApiTest() : saved_cmdline_(base::CommandLine::NO_PROGRAM) {}
31 31
32 ~ActivityLogApiTest() override { 32 ~ActivityLogApiTest() override {
33 ExtensionApiTest::SetUpCommandLine(&saved_cmdline_);
34 *base::CommandLine::ForCurrentProcess() = saved_cmdline_; 33 *base::CommandLine::ForCurrentProcess() = saved_cmdline_;
35 } 34 }
36 35
37 void SetUpCommandLine(base::CommandLine* command_line) override { 36 void SetUpCommandLine(base::CommandLine* command_line) override {
38 ExtensionApiTest::SetUpCommandLine(command_line); 37 ExtensionApiTest::SetUpCommandLine(command_line);
39 saved_cmdline_ = *base::CommandLine::ForCurrentProcess(); 38 saved_cmdline_ = *base::CommandLine::ForCurrentProcess();
40 command_line->AppendSwitch(switches::kEnableExtensionActivityLogging); 39 command_line->AppendSwitch(switches::kEnableExtensionActivityLogging);
41 } 40 }
42 41
43 std::unique_ptr<HttpResponse> HandleRequest(const HttpRequest& request) { 42 std::unique_ptr<HttpResponse> HandleRequest(const HttpRequest& request) {
(...skipping 27 matching lines...) Expand all
71 70
72 const Extension* friend_extension = LoadExtensionIncognito( 71 const Extension* friend_extension = LoadExtensionIncognito(
73 test_data_dir_.AppendASCII("activity_log_private/friend")); 72 test_data_dir_.AppendASCII("activity_log_private/friend"));
74 ASSERT_TRUE(friend_extension); 73 ASSERT_TRUE(friend_extension);
75 ASSERT_TRUE(RunExtensionTest("activity_log_private/test")); 74 ASSERT_TRUE(RunExtensionTest("activity_log_private/test"));
76 ActivityLog::GetInstance(profile())->SetWatchdogAppActiveForTesting(false); 75 ActivityLog::GetInstance(profile())->SetWatchdogAppActiveForTesting(false);
77 } 76 }
78 77
79 } // namespace extensions 78 } // namespace extensions
80 79
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698