Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: chrome/test/automation/automation_proxy_uitest.cc

Issue 5978003: Make IPC::Channel::Listener:OnMessageReceived have a return value indicating ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/automation/automation_proxy_uitest.h ('k') | chrome/test/automation/tab_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 755
756 // static 756 // static
757 const AutomationURLResponse ExternalTabUITestMockClient::http_200( 757 const AutomationURLResponse ExternalTabUITestMockClient::http_200(
758 "", 758 "",
759 "HTTP/0.9 200\r\n\r\n", 759 "HTTP/0.9 200\r\n\r\n",
760 0, 760 0,
761 base::Time(), 761 base::Time(),
762 "", 762 "",
763 0); 763 0);
764 764
765 void ExternalTabUITestMockClient::OnMessageReceived(const IPC::Message& msg) { 765 bool ExternalTabUITestMockClient::OnMessageReceived(const IPC::Message& msg) {
766 bool handled = true;
766 IPC_BEGIN_MESSAGE_MAP(ExternalTabUITestMockClient, msg) 767 IPC_BEGIN_MESSAGE_MAP(ExternalTabUITestMockClient, msg)
767 IPC_MESSAGE_HANDLER(AutomationMsg_DidNavigate, OnDidNavigate) 768 IPC_MESSAGE_HANDLER(AutomationMsg_DidNavigate, OnDidNavigate)
768 IPC_MESSAGE_HANDLER(AutomationMsg_ForwardMessageToExternalHost, 769 IPC_MESSAGE_HANDLER(AutomationMsg_ForwardMessageToExternalHost,
769 OnForwardMessageToExternalHost) 770 OnForwardMessageToExternalHost)
770 IPC_MESSAGE_HANDLER(AutomationMsg_RequestStart, OnRequestStart) 771 IPC_MESSAGE_HANDLER(AutomationMsg_RequestStart, OnRequestStart)
771 IPC_MESSAGE_HANDLER(AutomationMsg_RequestRead, OnRequestRead) 772 IPC_MESSAGE_HANDLER(AutomationMsg_RequestRead, OnRequestRead)
772 IPC_MESSAGE_HANDLER(AutomationMsg_RequestEnd, OnRequestEnd) 773 IPC_MESSAGE_HANDLER(AutomationMsg_RequestEnd, OnRequestEnd)
773 IPC_MESSAGE_HANDLER(AutomationMsg_SetCookieAsync, OnSetCookieAsync) 774 IPC_MESSAGE_HANDLER(AutomationMsg_SetCookieAsync, OnSetCookieAsync)
774 IPC_MESSAGE_HANDLER(AutomationMsg_TabLoaded, OnLoad) 775 IPC_MESSAGE_HANDLER(AutomationMsg_TabLoaded, OnLoad)
775 IPC_MESSAGE_HANDLER(AutomationMsg_AttachExternalTab, OnAttachExternalTab) 776 IPC_MESSAGE_HANDLER(AutomationMsg_AttachExternalTab, OnAttachExternalTab)
776 IPC_MESSAGE_HANDLER(AutomationMsg_OpenURL, OnOpenURL) 777 IPC_MESSAGE_HANDLER(AutomationMsg_OpenURL, OnOpenURL)
777 IPC_MESSAGE_HANDLER(AutomationMsg_NavigationStateChanged, 778 IPC_MESSAGE_HANDLER(AutomationMsg_NavigationStateChanged,
778 OnNavigationStateChanged) 779 OnNavigationStateChanged)
780 IPC_MESSAGE_UNHANDLED(handled = false)
779 IPC_END_MESSAGE_MAP() 781 IPC_END_MESSAGE_MAP()
782 return handled;
780 } 783 }
781 784
782 scoped_refptr<TabProxy> ExternalTabUITestMockClient::CreateHostWindowAndTab( 785 scoped_refptr<TabProxy> ExternalTabUITestMockClient::CreateHostWindowAndTab(
783 const ExternalTabSettings& settings) { 786 const ExternalTabSettings& settings) {
784 EXPECT_THAT(settings.parent, testing::IsNull()); 787 EXPECT_THAT(settings.parent, testing::IsNull());
785 788
786 host_window_ = CreateWindowW(L"Button", NULL, host_window_style_, 789 host_window_ = CreateWindowW(L"Button", NULL, host_window_style_,
787 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 790 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
788 NULL, NULL, NULL, NULL); 791 NULL, NULL, NULL, NULL);
789 EXPECT_THAT(host_window_, testing::Truly(::IsWindow)); 792 EXPECT_THAT(host_window_, testing::Truly(::IsWindow));
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1738 int diff_pixels_count = 0; 1741 int diff_pixels_count = 0;
1739 for (int x = 0; x < img_size.width(); ++x) { 1742 for (int x = 0; x < img_size.width(); ++x) {
1740 for (int y = 0; y < img_size.height(); ++y) { 1743 for (int y = 0; y < img_size.height(); ++y) {
1741 if (*snapshot_bmp.getAddr32(x, y) != *reference_bmp.getAddr32(x, y)) { 1744 if (*snapshot_bmp.getAddr32(x, y) != *reference_bmp.getAddr32(x, y)) {
1742 ++diff_pixels_count; 1745 ++diff_pixels_count;
1743 } 1746 }
1744 } 1747 }
1745 } 1748 }
1746 ASSERT_EQ(diff_pixels_count, 0); 1749 ASSERT_EQ(diff_pixels_count, 0);
1747 } 1750 }
OLDNEW
« no previous file with comments | « chrome/test/automation/automation_proxy_uitest.h ('k') | chrome/test/automation/tab_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698