| 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 | 6 |
| 7 #include "chrome/browser/extensions/activity_log/activity_log.h" | 7 #include "chrome/browser/extensions/activity_log/activity_log.h" |
| 8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
| 10 #include "extensions/common/extension_builder.h" | 10 #include "extensions/common/extension_builder.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 class ActivityLogApiTest : public ExtensionApiTest { | 22 class ActivityLogApiTest : public ExtensionApiTest { |
| 23 public: | 23 public: |
| 24 ActivityLogApiTest() : saved_cmdline_(CommandLine::NO_PROGRAM) {} | 24 ActivityLogApiTest() : saved_cmdline_(CommandLine::NO_PROGRAM) {} |
| 25 | 25 |
| 26 virtual ~ActivityLogApiTest() { | 26 virtual ~ActivityLogApiTest() { |
| 27 ExtensionApiTest::SetUpCommandLine(&saved_cmdline_); | 27 ExtensionApiTest::SetUpCommandLine(&saved_cmdline_); |
| 28 *CommandLine::ForCurrentProcess() = saved_cmdline_; | 28 *CommandLine::ForCurrentProcess() = saved_cmdline_; |
| 29 } | 29 } |
| 30 | 30 |
| 31 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 31 virtual void SetUpCommandLine(CommandLine* command_line) override { |
| 32 ExtensionApiTest::SetUpCommandLine(command_line); | 32 ExtensionApiTest::SetUpCommandLine(command_line); |
| 33 saved_cmdline_ = *CommandLine::ForCurrentProcess(); | 33 saved_cmdline_ = *CommandLine::ForCurrentProcess(); |
| 34 command_line->AppendSwitch(switches::kEnableExtensionActivityLogging); | 34 command_line->AppendSwitch(switches::kEnableExtensionActivityLogging); |
| 35 } | 35 } |
| 36 | 36 |
| 37 scoped_ptr<HttpResponse> HandleRequest(const HttpRequest& request) { | 37 scoped_ptr<HttpResponse> HandleRequest(const HttpRequest& request) { |
| 38 scoped_ptr<BasicHttpResponse> response(new BasicHttpResponse); | 38 scoped_ptr<BasicHttpResponse> response(new BasicHttpResponse); |
| 39 response->set_code(net::HTTP_OK); | 39 response->set_code(net::HTTP_OK); |
| 40 response->set_content("<html><head><title>ActivityLogTest</title>" | 40 response->set_content("<html><head><title>ActivityLogTest</title>" |
| 41 "</head><body>Hello World</body></html>"); | 41 "</head><body>Hello World</body></html>"); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 65 | 65 |
| 66 const Extension* friend_extension = LoadExtensionIncognito( | 66 const Extension* friend_extension = LoadExtensionIncognito( |
| 67 test_data_dir_.AppendASCII("activity_log_private/friend")); | 67 test_data_dir_.AppendASCII("activity_log_private/friend")); |
| 68 ASSERT_TRUE(friend_extension); | 68 ASSERT_TRUE(friend_extension); |
| 69 ASSERT_TRUE(RunExtensionTest("activity_log_private/test")); | 69 ASSERT_TRUE(RunExtensionTest("activity_log_private/test")); |
| 70 ActivityLog::GetInstance(profile())->SetWatchdogAppActiveForTesting(false); | 70 ActivityLog::GetInstance(profile())->SetWatchdogAppActiveForTesting(false); |
| 71 } | 71 } |
| 72 | 72 |
| 73 } // namespace extensions | 73 } // namespace extensions |
| 74 | 74 |
| OLD | NEW |