OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "app/app_switches.h" | 7 #include "app/app_switches.h" |
8 #include "app/message_box_flags.h" | 8 #include "app/message_box_flags.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 request_id, *response)); | 679 request_id, *response)); |
680 } | 680 } |
681 | 681 |
682 void ExternalTabUITestMockClient::ReplyData( | 682 void ExternalTabUITestMockClient::ReplyData( |
683 const std::string* data, int tab_handle, int request_id) { | 683 const std::string* data, int tab_handle, int request_id) { |
684 AutomationProxy::Send(new AutomationMsg_RequestData(tab_handle, | 684 AutomationProxy::Send(new AutomationMsg_RequestData(tab_handle, |
685 request_id, *data)); | 685 request_id, *data)); |
686 } | 686 } |
687 | 687 |
688 void ExternalTabUITestMockClient::ReplyEOF(int tab_handle, int request_id) { | 688 void ExternalTabUITestMockClient::ReplyEOF(int tab_handle, int request_id) { |
689 ReplyEnd(URLRequestStatus(), tab_handle, request_id); | 689 ReplyEnd(net::URLRequestStatus(), tab_handle, request_id); |
690 } | 690 } |
691 | 691 |
692 void ExternalTabUITestMockClient::ReplyEnd(const URLRequestStatus& status, | 692 void ExternalTabUITestMockClient::ReplyEnd(const net::URLRequestStatus& status, |
693 int tab_handle, int request_id) { | 693 int tab_handle, int request_id) { |
694 AutomationProxy::Send(new AutomationMsg_RequestEnd(tab_handle, | 694 AutomationProxy::Send(new AutomationMsg_RequestEnd(tab_handle, |
695 request_id, status)); | 695 request_id, status)); |
696 } | 696 } |
697 | 697 |
698 void ExternalTabUITestMockClient::Reply404(int tab_handle, int request_id) { | 698 void ExternalTabUITestMockClient::Reply404(int tab_handle, int request_id) { |
699 const AutomationURLResponse notfound("", "HTTP/1.1 404\r\n\r\n", 0, | 699 const AutomationURLResponse notfound("", "HTTP/1.1 404\r\n\r\n", 0, |
700 base::Time(), "", 0); | 700 base::Time(), "", 0); |
701 ReplyStarted(¬found, tab_handle, request_id); | 701 ReplyStarted(¬found, tab_handle, request_id); |
702 ReplyEOF(tab_handle, request_id); | 702 ReplyEOF(tab_handle, request_id); |
(...skipping 19 matching lines...) Expand all Loading... |
722 | 722 |
723 void ExternalTabUITestMockClient::IgnoreFavIconNetworkRequest() { | 723 void ExternalTabUITestMockClient::IgnoreFavIconNetworkRequest() { |
724 // Ignore favicon.ico | 724 // Ignore favicon.ico |
725 EXPECT_CALL(*this, OnRequestStart(_, testing::AllOf( | 725 EXPECT_CALL(*this, OnRequestStart(_, testing::AllOf( |
726 testing::Field(&AutomationURLRequest::url, | 726 testing::Field(&AutomationURLRequest::url, |
727 testing::EndsWith("favicon.ico")), | 727 testing::EndsWith("favicon.ico")), |
728 testing::Field(&AutomationURLRequest::method, StrEq("GET"))))) | 728 testing::Field(&AutomationURLRequest::method, StrEq("GET"))))) |
729 .Times(testing::AnyNumber()) | 729 .Times(testing::AnyNumber()) |
730 .WillRepeatedly(testing::WithArgs<0, 0>(testing::Invoke( | 730 .WillRepeatedly(testing::WithArgs<0, 0>(testing::Invoke( |
731 CreateFunctor(this, &ExternalTabUITestMockClient::ReplyEnd, | 731 CreateFunctor(this, &ExternalTabUITestMockClient::ReplyEnd, |
732 URLRequestStatus(URLRequestStatus::FAILED, 0))))); | 732 net::URLRequestStatus(net::URLRequestStatus::FAILED, 0))))); |
733 } | 733 } |
734 | 734 |
735 void ExternalTabUITestMockClient::InvalidateHandle( | 735 void ExternalTabUITestMockClient::InvalidateHandle( |
736 const IPC::Message& message) { | 736 const IPC::Message& message) { |
737 void* iter = NULL; | 737 void* iter = NULL; |
738 int handle; | 738 int handle; |
739 ASSERT_TRUE(message.ReadInt(&iter, &handle)); | 739 ASSERT_TRUE(message.ReadInt(&iter, &handle)); |
740 | 740 |
741 // Call base class | 741 // Call base class |
742 AutomationProxy::InvalidateHandle(message); | 742 AutomationProxy::InvalidateHandle(message); |
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1747 int diff_pixels_count = 0; | 1747 int diff_pixels_count = 0; |
1748 for (int x = 0; x < img_size.width(); ++x) { | 1748 for (int x = 0; x < img_size.width(); ++x) { |
1749 for (int y = 0; y < img_size.height(); ++y) { | 1749 for (int y = 0; y < img_size.height(); ++y) { |
1750 if (*snapshot_bmp.getAddr32(x, y) != *reference_bmp.getAddr32(x, y)) { | 1750 if (*snapshot_bmp.getAddr32(x, y) != *reference_bmp.getAddr32(x, y)) { |
1751 ++diff_pixels_count; | 1751 ++diff_pixels_count; |
1752 } | 1752 } |
1753 } | 1753 } |
1754 } | 1754 } |
1755 ASSERT_EQ(diff_pixels_count, 0); | 1755 ASSERT_EQ(diff_pixels_count, 0); |
1756 } | 1756 } |
OLD | NEW |