| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.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/activity_log/fullstream_ui_policy.h" | 10 #include "chrome/browser/extensions/activity_log/fullstream_ui_policy.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } | 59 } |
| 60 | 60 |
| 61 static void RetrieveActions_LogAndFetchActions( | 61 static void RetrieveActions_LogAndFetchActions( |
| 62 scoped_ptr<std::vector<scoped_refptr<Action> > > i) { | 62 scoped_ptr<std::vector<scoped_refptr<Action> > > i) { |
| 63 ASSERT_EQ(2, static_cast<int>(i->size())); | 63 ASSERT_EQ(2, static_cast<int>(i->size())); |
| 64 } | 64 } |
| 65 | 65 |
| 66 static void Arguments_Present( | 66 static void Arguments_Present( |
| 67 scoped_ptr<std::vector<scoped_refptr<Action> > > i) { | 67 scoped_ptr<std::vector<scoped_refptr<Action> > > i) { |
| 68 scoped_refptr<Action> last = i->front(); | 68 scoped_refptr<Action> last = i->front(); |
| 69 std::string args = "ID: odlameecjipmbmbejkplpemijjgpljce, CATEGORY: " | 69 std::string args = |
| 70 "call, API: extension.connect, ARGS: \"hello\", \"world\""; | 70 "ID=odlameecjipmbmbejkplpemijjgpljce CATEGORY=api_call " |
| 71 "API=extension.connect ARGS=[\"hello\",\"world\"] OTHER={}"; |
| 71 ASSERT_EQ(args, last->PrintForDebug()); | 72 ASSERT_EQ(args, last->PrintForDebug()); |
| 72 } | 73 } |
| 73 | 74 |
| 74 protected: | 75 protected: |
| 75 ExtensionService* extension_service_; | 76 ExtensionService* extension_service_; |
| 76 scoped_ptr<TestingProfile> profile_; | 77 scoped_ptr<TestingProfile> profile_; |
| 77 content::TestBrowserThreadBundle thread_bundle_; | 78 content::TestBrowserThreadBundle thread_bundle_; |
| 78 // Used to preserve a copy of the original command line. | 79 // Used to preserve a copy of the original command line. |
| 79 // The test framework will do this itself as well. However, by then, | 80 // The test framework will do this itself as well. However, by then, |
| 80 // it is too late to call ActivityLog::RecomputeLoggingIsEnabled() in | 81 // it is too late to call ActivityLog::RecomputeLoggingIsEnabled() in |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 args->Set(0, new base::StringValue("hello")); | 144 args->Set(0, new base::StringValue("hello")); |
| 144 args->Set(1, new base::StringValue("world")); | 145 args->Set(1, new base::StringValue("world")); |
| 145 policy->ProcessAction(ActivityLogPolicy::ACTION_API, extension->id(), | 146 policy->ProcessAction(ActivityLogPolicy::ACTION_API, extension->id(), |
| 146 std::string("extension.connect"), GURL(), args.get(), NULL); | 147 std::string("extension.connect"), GURL(), args.get(), NULL); |
| 147 policy->ReadData(extension->id(), 0, | 148 policy->ReadData(extension->id(), 0, |
| 148 base::Bind(FullStreamUIPolicyTest::Arguments_Present)); | 149 base::Bind(FullStreamUIPolicyTest::Arguments_Present)); |
| 149 policy->Close(); | 150 policy->Close(); |
| 150 } | 151 } |
| 151 | 152 |
| 152 } // namespace extensions | 153 } // namespace extensions |
| OLD | NEW |