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> |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 .Build()) | 371 .Build()) |
372 .Build(); | 372 .Build(); |
373 extension_service_->AddExtension(extension.get()); | 373 extension_service_->AddExtension(extension.get()); |
374 GURL gurl("http://www.google.com"); | 374 GURL gurl("http://www.google.com"); |
375 | 375 |
376 // Write some API calls | 376 // Write some API calls |
377 scoped_refptr<Action> action_api = new Action(extension->id(), | 377 scoped_refptr<Action> action_api = new Action(extension->id(), |
378 base::Time::Now(), | 378 base::Time::Now(), |
379 Action::ACTION_API_CALL, | 379 Action::ACTION_API_CALL, |
380 "tabs.testMethod"); | 380 "tabs.testMethod"); |
381 action_api->set_args(base::WrapUnique(new base::ListValue())); | 381 action_api->set_args(base::MakeUnique<base::ListValue>()); |
382 policy->ProcessAction(action_api); | 382 policy->ProcessAction(action_api); |
383 | 383 |
384 scoped_refptr<Action> action_dom = new Action(extension->id(), | 384 scoped_refptr<Action> action_dom = new Action(extension->id(), |
385 base::Time::Now(), | 385 base::Time::Now(), |
386 Action::ACTION_DOM_ACCESS, | 386 Action::ACTION_DOM_ACCESS, |
387 "document.write"); | 387 "document.write"); |
388 action_dom->set_args(base::WrapUnique(new base::ListValue())); | 388 action_dom->set_args(base::MakeUnique<base::ListValue>()); |
389 action_dom->set_page_url(gurl); | 389 action_dom->set_page_url(gurl); |
390 policy->ProcessAction(action_dom); | 390 policy->ProcessAction(action_dom); |
391 | 391 |
392 CheckReadData( | 392 CheckReadData( |
393 policy, | 393 policy, |
394 extension->id(), | 394 extension->id(), |
395 0, | 395 0, |
396 base::Bind(&FullStreamUIPolicyTest::RetrieveActions_LogAndFetchActions)); | 396 base::Bind(&FullStreamUIPolicyTest::RetrieveActions_LogAndFetchActions)); |
397 | 397 |
398 policy->Close(); | 398 policy->Close(); |
(...skipping 11 matching lines...) Expand all Loading... |
410 .Build()) | 410 .Build()) |
411 .Build(); | 411 .Build(); |
412 extension_service_->AddExtension(extension.get()); | 412 extension_service_->AddExtension(extension.get()); |
413 GURL gurl("http://www.google.com"); | 413 GURL gurl("http://www.google.com"); |
414 | 414 |
415 // Write some API calls | 415 // Write some API calls |
416 scoped_refptr<Action> action_api = new Action(extension->id(), | 416 scoped_refptr<Action> action_api = new Action(extension->id(), |
417 base::Time::Now(), | 417 base::Time::Now(), |
418 Action::ACTION_API_CALL, | 418 Action::ACTION_API_CALL, |
419 "tabs.testMethod"); | 419 "tabs.testMethod"); |
420 action_api->set_args(base::WrapUnique(new base::ListValue())); | 420 action_api->set_args(base::MakeUnique<base::ListValue>()); |
421 policy->ProcessAction(action_api); | 421 policy->ProcessAction(action_api); |
422 | 422 |
423 scoped_refptr<Action> action_dom = new Action(extension->id(), | 423 scoped_refptr<Action> action_dom = new Action(extension->id(), |
424 base::Time::Now(), | 424 base::Time::Now(), |
425 Action::ACTION_DOM_ACCESS, | 425 Action::ACTION_DOM_ACCESS, |
426 "document.write"); | 426 "document.write"); |
427 action_dom->set_args(base::WrapUnique(new base::ListValue())); | 427 action_dom->set_args(base::MakeUnique<base::ListValue>()); |
428 action_dom->set_page_url(gurl); | 428 action_dom->set_page_url(gurl); |
429 policy->ProcessAction(action_dom); | 429 policy->ProcessAction(action_dom); |
430 | 430 |
431 CheckReadFilteredData( | 431 CheckReadFilteredData( |
432 policy, | 432 policy, |
433 extension->id(), | 433 extension->id(), |
434 Action::ACTION_API_CALL, | 434 Action::ACTION_API_CALL, |
435 "tabs.testMethod", | 435 "tabs.testMethod", |
436 "", | 436 "", |
437 "", | 437 "", |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 .Build()) | 851 .Build()) |
852 .Build(); | 852 .Build(); |
853 extension_service_->AddExtension(extension.get()); | 853 extension_service_->AddExtension(extension.get()); |
854 GURL gurl("http://www.google.com"); | 854 GURL gurl("http://www.google.com"); |
855 | 855 |
856 // Write some API calls. | 856 // Write some API calls. |
857 scoped_refptr<Action> action_api = new Action(extension->id(), | 857 scoped_refptr<Action> action_api = new Action(extension->id(), |
858 base::Time::Now(), | 858 base::Time::Now(), |
859 Action::ACTION_API_CALL, | 859 Action::ACTION_API_CALL, |
860 "tabs.testMethod"); | 860 "tabs.testMethod"); |
861 action_api->set_args(base::WrapUnique(new base::ListValue())); | 861 action_api->set_args(base::MakeUnique<base::ListValue>()); |
862 policy->ProcessAction(action_api); | 862 policy->ProcessAction(action_api); |
863 | 863 |
864 scoped_refptr<Action> action_dom = new Action(extension->id(), | 864 scoped_refptr<Action> action_dom = new Action(extension->id(), |
865 base::Time::Now(), | 865 base::Time::Now(), |
866 Action::ACTION_DOM_ACCESS, | 866 Action::ACTION_DOM_ACCESS, |
867 "document.write"); | 867 "document.write"); |
868 action_dom->set_args(base::WrapUnique(new base::ListValue())); | 868 action_dom->set_args(base::MakeUnique<base::ListValue>()); |
869 action_dom->set_page_url(gurl); | 869 action_dom->set_page_url(gurl); |
870 policy->ProcessAction(action_dom); | 870 policy->ProcessAction(action_dom); |
871 | 871 |
872 CheckReadData( | 872 CheckReadData( |
873 policy, | 873 policy, |
874 extension->id(), | 874 extension->id(), |
875 0, | 875 0, |
876 base::Bind(&FullStreamUIPolicyTest::RetrieveActions_LogAndFetchActions)); | 876 base::Bind(&FullStreamUIPolicyTest::RetrieveActions_LogAndFetchActions)); |
877 | 877 |
878 // Now delete them. | 878 // Now delete them. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
940 action_ids.push_back(3); | 940 action_ids.push_back(3); |
941 action_ids.push_back(4); | 941 action_ids.push_back(4); |
942 CheckRemoveActions( | 942 CheckRemoveActions( |
943 policy, action_ids, base::Bind(&FullStreamUIPolicyTest::Action2Deleted)); | 943 policy, action_ids, base::Bind(&FullStreamUIPolicyTest::Action2Deleted)); |
944 action_ids.clear(); | 944 action_ids.clear(); |
945 | 945 |
946 policy->Close(); | 946 policy->Close(); |
947 } | 947 } |
948 | 948 |
949 } // namespace extensions | 949 } // namespace extensions |
OLD | NEW |