OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 db->AdviseFlush(queue_.size()); | 105 db->AdviseFlush(queue_.size()); |
106 } | 106 } |
107 | 107 |
108 class ActivityDatabaseTest : public ChromeRenderViewHostTestHarness { | 108 class ActivityDatabaseTest : public ChromeRenderViewHostTestHarness { |
109 protected: | 109 protected: |
110 void SetUp() override { | 110 void SetUp() override { |
111 ChromeRenderViewHostTestHarness::SetUp(); | 111 ChromeRenderViewHostTestHarness::SetUp(); |
112 #if defined OS_CHROMEOS | 112 #if defined OS_CHROMEOS |
113 test_user_manager_.reset(new chromeos::ScopedTestUserManager()); | 113 test_user_manager_.reset(new chromeos::ScopedTestUserManager()); |
114 #endif | 114 #endif |
115 CommandLine command_line(CommandLine::NO_PROGRAM); | 115 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); |
116 CommandLine::ForCurrentProcess()->AppendSwitch( | 116 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
117 switches::kEnableExtensionActivityLogTesting); | 117 switches::kEnableExtensionActivityLogTesting); |
118 } | 118 } |
119 | 119 |
120 void TearDown() override { | 120 void TearDown() override { |
121 #if defined OS_CHROMEOS | 121 #if defined OS_CHROMEOS |
122 test_user_manager_.reset(); | 122 test_user_manager_.reset(); |
123 #endif | 123 #endif |
124 ChromeRenderViewHostTestHarness::TearDown(); | 124 ChromeRenderViewHostTestHarness::TearDown(); |
125 } | 125 } |
126 | 126 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 ActivityDatabaseTestPolicy* delegate = new ActivityDatabaseTestPolicy(); | 277 ActivityDatabaseTestPolicy* delegate = new ActivityDatabaseTestPolicy(); |
278 ActivityDatabase* activity_db = new ActivityDatabase(delegate); | 278 ActivityDatabase* activity_db = new ActivityDatabase(delegate); |
279 scoped_refptr<Action> action = new Action( | 279 scoped_refptr<Action> action = new Action( |
280 "punky", base::Time::Now(), Action::ACTION_API_CALL, "brewster"); | 280 "punky", base::Time::Now(), Action::ACTION_API_CALL, "brewster"); |
281 action->mutable_args()->AppendString("woof"); | 281 action->mutable_args()->AppendString("woof"); |
282 delegate->Record(activity_db, action); | 282 delegate->Record(activity_db, action); |
283 activity_db->Close(); | 283 activity_db->Close(); |
284 } | 284 } |
285 | 285 |
286 } // namespace extensions | 286 } // namespace extensions |
OLD | NEW |