| Index: extensions/browser/api/declarative/declarative_rule_unittest.cc
|
| diff --git a/extensions/browser/api/declarative/declarative_rule_unittest.cc b/extensions/browser/api/declarative/declarative_rule_unittest.cc
|
| index 6fa3d2fad940b5439ec77f0942809d4660ebb525..93ec58b4026fbf83c5a689c1caf380f87e5bcf11 100644
|
| --- a/extensions/browser/api/declarative/declarative_rule_unittest.cc
|
| +++ b/extensions/browser/api/declarative/declarative_rule_unittest.cc
|
| @@ -22,11 +22,6 @@ namespace extensions {
|
|
|
| namespace {
|
|
|
| -template<typename T>
|
| -linked_ptr<T> ScopedToLinkedPtr(scoped_ptr<T> ptr) {
|
| - return linked_ptr<T>(ptr.release());
|
| -}
|
| -
|
| scoped_ptr<base::DictionaryValue> SimpleManifest() {
|
| return DictionaryBuilder()
|
| .Set("name", "extension")
|
| @@ -70,8 +65,8 @@ typedef DeclarativeConditionSet<RecordingCondition> RecordingConditionSet;
|
| TEST(DeclarativeConditionTest, ErrorConditionSet) {
|
| URLMatcher matcher;
|
| RecordingConditionSet::Values conditions;
|
| - conditions.push_back(ScopedToLinkedPtr(ParseJson("{\"key\": 1}")));
|
| - conditions.push_back(ScopedToLinkedPtr(ParseJson("{\"bad_key\": 2}")));
|
| + conditions.push_back(ParseJson("{\"key\": 1}"));
|
| + conditions.push_back(ParseJson("{\"bad_key\": 2}"));
|
|
|
| std::string error;
|
| scoped_ptr<RecordingConditionSet> result = RecordingConditionSet::Create(
|
| @@ -83,8 +78,8 @@ TEST(DeclarativeConditionTest, ErrorConditionSet) {
|
| TEST(DeclarativeConditionTest, CreateConditionSet) {
|
| URLMatcher matcher;
|
| RecordingConditionSet::Values conditions;
|
| - conditions.push_back(ScopedToLinkedPtr(ParseJson("{\"key\": 1}")));
|
| - conditions.push_back(ScopedToLinkedPtr(ParseJson("[\"val1\", 2]")));
|
| + conditions.push_back(ParseJson("{\"key\": 1}"));
|
| + conditions.push_back(ParseJson("[\"val1\", 2]"));
|
|
|
| // Test insertion
|
| std::string error;
|
| @@ -157,14 +152,10 @@ struct FulfillableCondition {
|
| TEST(DeclarativeConditionTest, FulfillConditionSet) {
|
| typedef DeclarativeConditionSet<FulfillableCondition> FulfillableConditionSet;
|
| FulfillableConditionSet::Values conditions;
|
| - conditions.push_back(ScopedToLinkedPtr(ParseJson(
|
| - "{\"url_id\": 1, \"max\": 3}")));
|
| - conditions.push_back(ScopedToLinkedPtr(ParseJson(
|
| - "{\"url_id\": 2, \"max\": 5}")));
|
| - conditions.push_back(ScopedToLinkedPtr(ParseJson(
|
| - "{\"url_id\": 3, \"max\": 1}")));
|
| - conditions.push_back(ScopedToLinkedPtr(ParseJson(
|
| - "{\"max\": -5}"))); // No url.
|
| + conditions.push_back(ParseJson("{\"url_id\": 1, \"max\": 3}"));
|
| + conditions.push_back(ParseJson("{\"url_id\": 2, \"max\": 5}"));
|
| + conditions.push_back(ParseJson("{\"url_id\": 3, \"max\": 1}"));
|
| + conditions.push_back(ParseJson("{\"max\": -5}")); // No url.
|
|
|
| // Test insertion
|
| std::string error;
|
| @@ -264,8 +255,8 @@ typedef DeclarativeActionSet<SummingAction> SummingActionSet;
|
|
|
| TEST(DeclarativeActionTest, ErrorActionSet) {
|
| SummingActionSet::Values actions;
|
| - actions.push_back(ScopedToLinkedPtr(ParseJson("{\"value\": 1}")));
|
| - actions.push_back(ScopedToLinkedPtr(ParseJson("{\"error\": \"the error\"}")));
|
| + actions.push_back(ParseJson("{\"value\": 1}"));
|
| + actions.push_back(ParseJson("{\"error\": \"the error\"}"));
|
|
|
| std::string error;
|
| bool bad = false;
|
| @@ -276,8 +267,8 @@ TEST(DeclarativeActionTest, ErrorActionSet) {
|
| EXPECT_FALSE(result);
|
|
|
| actions.clear();
|
| - actions.push_back(ScopedToLinkedPtr(ParseJson("{\"value\": 1}")));
|
| - actions.push_back(ScopedToLinkedPtr(ParseJson("{\"bad\": 3}")));
|
| + actions.push_back(ParseJson("{\"value\": 1}"));
|
| + actions.push_back(ParseJson("{\"bad\": 3}"));
|
| result = SummingActionSet::Create(NULL, NULL, actions, &error, &bad);
|
| EXPECT_EQ("", error);
|
| EXPECT_TRUE(bad);
|
| @@ -286,10 +277,10 @@ TEST(DeclarativeActionTest, ErrorActionSet) {
|
|
|
| TEST(DeclarativeActionTest, ApplyActionSet) {
|
| SummingActionSet::Values actions;
|
| - actions.push_back(ScopedToLinkedPtr(ParseJson(
|
| - "{\"value\": 1,"
|
| - " \"priority\": 5}")));
|
| - actions.push_back(ScopedToLinkedPtr(ParseJson("{\"value\": 2}")));
|
| + actions.push_back(
|
| + ParseJson("{\"value\": 1,"
|
| + " \"priority\": 5}"));
|
| + actions.push_back(ParseJson("{\"value\": 2}"));
|
|
|
| // Test insertion
|
| std::string error;
|
|
|