OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/test/ui/javascript_test_util.h" | 5 #include "chrome/test/ui/javascript_test_util.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 EXPECT_TRUE(root.get()); | 22 EXPECT_TRUE(root.get()); |
23 if (!root.get()) | 23 if (!root.get()) |
24 return false; | 24 return false; |
25 | 25 |
26 EXPECT_TRUE(root->IsType(Value::TYPE_DICTIONARY)); | 26 EXPECT_TRUE(root->IsType(Value::TYPE_DICTIONARY)); |
27 if (!root->IsType(Value::TYPE_DICTIONARY)) | 27 if (!root->IsType(Value::TYPE_DICTIONARY)) |
28 return false; | 28 return false; |
29 | 29 |
30 DictionaryValue* dict = static_cast<DictionaryValue*>(root.get()); | 30 DictionaryValue* dict = static_cast<DictionaryValue*>(root.get()); |
31 | 31 |
32 DictionaryValue::key_iterator it = dict->begin_keys(); | 32 for (DictionaryValue::key_iterator it = dict->begin_keys(); |
33 for (; it != dict->end_keys(); ++it) { | 33 it != dict->end_keys(); ++it) { |
34 Value* value = NULL; | 34 Value* value = NULL; |
35 bool succeeded = dict->Get(*it, &value); | 35 bool succeeded = dict->GetWithoutPathExpansion(*it, &value); |
36 | 36 |
37 EXPECT_TRUE(succeeded); | 37 EXPECT_TRUE(succeeded); |
38 if (!succeeded) | 38 if (!succeeded) |
39 continue; | 39 continue; |
40 | 40 |
41 EXPECT_TRUE(value->IsType(Value::TYPE_STRING)); | 41 EXPECT_TRUE(value->IsType(Value::TYPE_STRING)); |
42 if (value->IsType(Value::TYPE_STRING)) { | 42 if (value->IsType(Value::TYPE_STRING)) { |
43 std::string key = WideToUTF8(*it); | 43 std::string key = WideToUTF8(*it); |
44 | 44 |
45 std::string result; | 45 std::string result; |
46 succeeded = value->GetAsString(&result); | 46 succeeded = value->GetAsString(&result); |
47 EXPECT_TRUE(succeeded); | 47 EXPECT_TRUE(succeeded); |
48 | 48 |
49 if (succeeded) | 49 if (succeeded) |
50 results->insert(std::make_pair(key, result)); | 50 results->insert(std::make_pair(key, result)); |
51 } | 51 } |
52 } | 52 } |
53 | 53 |
54 return true; | 54 return true; |
55 } | 55 } |
OLD | NEW |