| 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 "base/values.h" |    5 #include "base/values.h" | 
|    6 #include "tools/json_schema_compiler/test/idl_basics.h" |    6 #include "tools/json_schema_compiler/test/idl_basics.h" | 
|    7 #include "tools/json_schema_compiler/test/idl_object_types.h" |    7 #include "tools/json_schema_compiler/test/idl_object_types.h" | 
|    8  |    8  | 
|    9 #include "testing/gtest/include/gtest/gtest.h" |    9 #include "testing/gtest/include/gtest/gtest.h" | 
|   10  |   10  | 
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   85   f7_params = Function7::Params::Create(list); |   85   f7_params = Function7::Params::Create(list); | 
|   86   EXPECT_EQ(7, *(f7_params->arg)); |   86   EXPECT_EQ(7, *(f7_params->arg)); | 
|   87  |   87  | 
|   88   // Similar to above, but a function with one required and one optional |   88   // Similar to above, but a function with one required and one optional | 
|   89   // argument. |   89   // argument. | 
|   90   list.Clear(); |   90   list.Clear(); | 
|   91   list.Append(new base::FundamentalValue(8)); |   91   list.Append(new base::FundamentalValue(8)); | 
|   92   scoped_ptr<Function8::Params> f8_params = Function8::Params::Create(list); |   92   scoped_ptr<Function8::Params> f8_params = Function8::Params::Create(list); | 
|   93   EXPECT_EQ(8, f8_params->arg1); |   93   EXPECT_EQ(8, f8_params->arg1); | 
|   94   EXPECT_EQ(NULL, f8_params->arg2.get()); |   94   EXPECT_EQ(NULL, f8_params->arg2.get()); | 
|   95   list.Append(base::Value::CreateStringValue("foo")); |   95   list.Append(new base::StringValue("foo")); | 
|   96   f8_params = Function8::Params::Create(list); |   96   f8_params = Function8::Params::Create(list); | 
|   97   EXPECT_EQ(8, f8_params->arg1); |   97   EXPECT_EQ(8, f8_params->arg1); | 
|   98   EXPECT_EQ("foo", *(f8_params->arg2)); |   98   EXPECT_EQ("foo", *(f8_params->arg2)); | 
|   99  |   99  | 
|  100   // Test a function with an optional argument of custom type. |  100   // Test a function with an optional argument of custom type. | 
|  101   list.Clear(); |  101   list.Clear(); | 
|  102   scoped_ptr<Function9::Params> f9_params = Function9::Params::Create(list); |  102   scoped_ptr<Function9::Params> f9_params = Function9::Params::Create(list); | 
|  103   EXPECT_EQ(NULL, f9_params->arg.get()); |  103   EXPECT_EQ(NULL, f9_params->arg.get()); | 
|  104   list.Clear(); |  104   list.Clear(); | 
|  105   base::DictionaryValue* tmp = new base::DictionaryValue(); |  105   base::DictionaryValue* tmp = new base::DictionaryValue(); | 
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  190                                                       &icon)); |  190                                                       &icon)); | 
|  191   base::ListValue list; |  191   base::ListValue list; | 
|  192   list.Append(icon_props.release()); |  192   list.Append(icon_props.release()); | 
|  193   scoped_ptr<ObjectFunction1::Params> params = |  193   scoped_ptr<ObjectFunction1::Params> params = | 
|  194     ObjectFunction1::Params::Create(list); |  194     ObjectFunction1::Params::Create(list); | 
|  195   ASSERT_TRUE(params.get() != NULL); |  195   ASSERT_TRUE(params.get() != NULL); | 
|  196   std::string tmp; |  196   std::string tmp; | 
|  197   EXPECT_TRUE(params->icon.additional_properties.GetString("hello", &tmp)); |  197   EXPECT_TRUE(params->icon.additional_properties.GetString("hello", &tmp)); | 
|  198   EXPECT_EQ("world", tmp); |  198   EXPECT_EQ("world", tmp); | 
|  199 } |  199 } | 
| OLD | NEW |