OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/automation/tab_proxy.h" | 5 #include "chrome/test/automation/tab_proxy.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/common/json_value_serializer.h" | 10 #include "chrome/common/json_value_serializer.h" |
(...skipping 537 matching lines...) Loading... |
548 if (!succeeded) { | 548 if (!succeeded) { |
549 delete response; | 549 delete response; |
550 return false; | 550 return false; |
551 } | 551 } |
552 // Wrap |json| in an array before deserializing because valid JSON has an | 552 // Wrap |json| in an array before deserializing because valid JSON has an |
553 // array or an object as the root. | 553 // array or an object as the root. |
554 json.insert(0, "["); | 554 json.insert(0, "["); |
555 json.append("]"); | 555 json.append("]"); |
556 | 556 |
557 JSONStringValueSerializer deserializer(json); | 557 JSONStringValueSerializer deserializer(json); |
558 succeeded = deserializer.Deserialize(value, NULL); | 558 *value = deserializer.Deserialize(NULL); |
559 | 559 |
560 delete response; | 560 delete response; |
561 return succeeded; | 561 return *value != NULL; |
562 } | 562 } |
563 | 563 |
564 bool TabProxy::GetConstrainedWindowCount(int* count) const { | 564 bool TabProxy::GetConstrainedWindowCount(int* count) const { |
565 if (!is_valid()) | 565 if (!is_valid()) |
566 return false; | 566 return false; |
567 | 567 |
568 if (!count) { | 568 if (!count) { |
569 NOTREACHED(); | 569 NOTREACHED(); |
570 return false; | 570 return false; |
571 } | 571 } |
(...skipping 507 matching lines...) Loading... |
1079 | 1079 |
1080 scoped_ptr<IPC::Message> response_deleter(response); // Delete on return. | 1080 scoped_ptr<IPC::Message> response_deleter(response); // Delete on return. |
1081 if (!succeeded) | 1081 if (!succeeded) |
1082 return false; | 1082 return false; |
1083 | 1083 |
1084 void* iter = NULL; | 1084 void* iter = NULL; |
1085 bool successed_set_value = false; | 1085 bool successed_set_value = false; |
1086 succeeded = response->ReadBool(&iter, &successed_set_value); | 1086 succeeded = response->ReadBool(&iter, &successed_set_value); |
1087 return succeeded && successed_set_value; | 1087 return succeeded && successed_set_value; |
1088 } | 1088 } |
OLD | NEW |