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 "chrome/browser/extensions/activity_log/fullstream_ui_policy.h" | 5 #include "chrome/browser/extensions/activity_log/fullstream_ui_policy.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/cancelable_callback.h" | 12 #include "base/cancelable_callback.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/location.h" | 14 #include "base/location.h" |
15 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
16 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
17 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
18 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
19 #include "base/synchronization/waitable_event.h" | 19 #include "base/synchronization/waitable_event.h" |
20 #include "base/test/simple_test_clock.h" | 20 #include "base/test/simple_test_clock.h" |
21 #include "base/test/test_timeouts.h" | 21 #include "base/test/test_timeouts.h" |
22 #include "base/threading/thread_task_runner_handle.h" | 22 #include "base/threading/thread_task_runner_handle.h" |
| 23 #include "base/values.h" |
23 #include "build/build_config.h" | 24 #include "build/build_config.h" |
24 #include "chrome/browser/extensions/activity_log/activity_log.h" | 25 #include "chrome/browser/extensions/activity_log/activity_log.h" |
25 #include "chrome/browser/extensions/extension_service.h" | 26 #include "chrome/browser/extensions/extension_service.h" |
26 #include "chrome/browser/extensions/test_extension_system.h" | 27 #include "chrome/browser/extensions/test_extension_system.h" |
27 #include "chrome/common/chrome_constants.h" | 28 #include "chrome/common/chrome_constants.h" |
28 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
29 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 30 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
30 #include "chrome/test/base/testing_profile.h" | 31 #include "chrome/test/base/testing_profile.h" |
31 #include "content/public/test/test_browser_thread_bundle.h" | 32 #include "content/public/test/test_browser_thread_bundle.h" |
32 #include "extensions/common/extension_builder.h" | 33 #include "extensions/common/extension_builder.h" |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 ExtensionBuilder() | 505 ExtensionBuilder() |
505 .SetManifest(DictionaryBuilder() | 506 .SetManifest(DictionaryBuilder() |
506 .Set("name", "Test extension") | 507 .Set("name", "Test extension") |
507 .Set("version", "1.0.0") | 508 .Set("version", "1.0.0") |
508 .Set("manifest_version", 2) | 509 .Set("manifest_version", 2) |
509 .Build()) | 510 .Build()) |
510 .Build(); | 511 .Build(); |
511 extension_service_->AddExtension(extension.get()); | 512 extension_service_->AddExtension(extension.get()); |
512 | 513 |
513 std::unique_ptr<base::ListValue> args(new base::ListValue()); | 514 std::unique_ptr<base::ListValue> args(new base::ListValue()); |
514 args->Set(0, new base::Value("hello")); | 515 args->Set(0, base::MakeUnique<base::Value>("hello")); |
515 args->Set(1, new base::Value("world")); | 516 args->Set(1, base::MakeUnique<base::Value>("world")); |
516 scoped_refptr<Action> action = new Action(extension->id(), | 517 scoped_refptr<Action> action = new Action(extension->id(), |
517 base::Time::Now(), | 518 base::Time::Now(), |
518 Action::ACTION_API_CALL, | 519 Action::ACTION_API_CALL, |
519 "extension.connect"); | 520 "extension.connect"); |
520 action->set_args(std::move(args)); | 521 action->set_args(std::move(args)); |
521 | 522 |
522 policy->ProcessAction(action); | 523 policy->ProcessAction(action); |
523 CheckReadData(policy, | 524 CheckReadData(policy, |
524 extension->id(), | 525 extension->id(), |
525 0, | 526 0, |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
940 action_ids.push_back(3); | 941 action_ids.push_back(3); |
941 action_ids.push_back(4); | 942 action_ids.push_back(4); |
942 CheckRemoveActions( | 943 CheckRemoveActions( |
943 policy, action_ids, base::Bind(&FullStreamUIPolicyTest::Action2Deleted)); | 944 policy, action_ids, base::Bind(&FullStreamUIPolicyTest::Action2Deleted)); |
944 action_ids.clear(); | 945 action_ids.clear(); |
945 | 946 |
946 policy->Close(); | 947 policy->Close(); |
947 } | 948 } |
948 | 949 |
949 } // namespace extensions | 950 } // namespace extensions |
OLD | NEW |