| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |