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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 testing::EndsWith("favicon.ico")), | 750 testing::EndsWith("favicon.ico")), |
751 testing::Field(&AutomationURLRequest::method, StrEq("GET"))))) | 751 testing::Field(&AutomationURLRequest::method, StrEq("GET"))))) |
752 .Times(testing::AnyNumber()) | 752 .Times(testing::AnyNumber()) |
753 .WillRepeatedly(testing::WithArgs<0, 0>(testing::Invoke( | 753 .WillRepeatedly(testing::WithArgs<0, 0>(testing::Invoke( |
754 CreateFunctor(this, &ExternalTabUITestMockClient::ReplyEnd, | 754 CreateFunctor(this, &ExternalTabUITestMockClient::ReplyEnd, |
755 net::URLRequestStatus(net::URLRequestStatus::FAILED, 0))))); | 755 net::URLRequestStatus(net::URLRequestStatus::FAILED, 0))))); |
756 } | 756 } |
757 | 757 |
758 void ExternalTabUITestMockClient::InvalidateHandle( | 758 void ExternalTabUITestMockClient::InvalidateHandle( |
759 const IPC::Message& message) { | 759 const IPC::Message& message) { |
760 void* iter = NULL; | 760 PickleIterator iter(message); |
761 int handle; | 761 int handle; |
762 ASSERT_TRUE(message.ReadInt(&iter, &handle)); | 762 ASSERT_TRUE(message.ReadInt(&iter, &handle)); |
763 | 763 |
764 // Call base class | 764 // Call base class |
765 AutomationProxy::InvalidateHandle(message); | 765 AutomationProxy::InvalidateHandle(message); |
766 HandleClosed(handle); | 766 HandleClosed(handle); |
767 } | 767 } |
768 | 768 |
769 // static | 769 // static |
770 ExternalTabSettings ExternalTabUITestMockClient::GetDefaultSettings() { | 770 ExternalTabSettings ExternalTabUITestMockClient::GetDefaultSettings() { |
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 | 1581 |
1582 std::string data; | 1582 std::string data; |
1583 ASSERT_NO_FATAL_FAILURE(AssertReadPNG(snapshot_path_, &data)); | 1583 ASSERT_NO_FATAL_FAILURE(AssertReadPNG(snapshot_path_, &data)); |
1584 EXPECT_STREQ(kReferenceMd5, base::MD5String(data).c_str()); | 1584 EXPECT_STREQ(kReferenceMd5, base::MD5String(data).c_str()); |
1585 if (CommandLine::ForCurrentProcess()->HasSwitch("dump-test-image")) { | 1585 if (CommandLine::ForCurrentProcess()->HasSwitch("dump-test-image")) { |
1586 FilePath path(FILE_PATH_LITERAL("snapshot.png")); | 1586 FilePath path(FILE_PATH_LITERAL("snapshot.png")); |
1587 EXPECT_EQ(file_util::WriteFile(path, &data[0], data.length()), | 1587 EXPECT_EQ(file_util::WriteFile(path, &data[0], data.length()), |
1588 static_cast<int>(data.length())); | 1588 static_cast<int>(data.length())); |
1589 } | 1589 } |
1590 } | 1590 } |
OLD | NEW |