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

Side by Side Diff: content/common/cc_messages_unittest.cc

Issue 12378053: Move Mailbox from cc to gpu, and its traits to gpu/ipc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
OLDNEW
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 "content/common/cc_messages.h" 5 #include "content/common/cc_messages.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "cc/compositor_frame.h" 9 #include "cc/compositor_frame.h"
10 #include "ipc/ipc_message.h" 10 #include "ipc/ipc_message.h"
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 7, 5, 3, 1, 2, 4, 6, 8, 0, 508 0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 7, 5, 3, 1, 2, 4, 6, 8, 0,
509 0, 9, 8, 7 509 0, 9, 8, 7
510 }; 510 };
511 511
512 TransferableResource arbitrary_resource1; 512 TransferableResource arbitrary_resource1;
513 arbitrary_resource1.id = 2178312; 513 arbitrary_resource1.id = 2178312;
514 arbitrary_resource1.sync_point = arbitrary_uint1; 514 arbitrary_resource1.sync_point = arbitrary_uint1;
515 arbitrary_resource1.format = 7; 515 arbitrary_resource1.format = 7;
516 arbitrary_resource1.filter = 53; 516 arbitrary_resource1.filter = 53;
517 arbitrary_resource1.size = gfx::Size(37189, 123123); 517 arbitrary_resource1.size = gfx::Size(37189, 123123);
518 arbitrary_resource1.mailbox.setName(arbitrary_mailbox1); 518 arbitrary_resource1.mailbox.SetName(arbitrary_mailbox1);
519 519
520 TransferableResource arbitrary_resource2; 520 TransferableResource arbitrary_resource2;
521 arbitrary_resource2.id = 789132; 521 arbitrary_resource2.id = 789132;
522 arbitrary_resource1.sync_point = arbitrary_uint2; 522 arbitrary_resource1.sync_point = arbitrary_uint2;
523 arbitrary_resource2.format = 30; 523 arbitrary_resource2.format = 30;
524 arbitrary_resource1.filter = 47; 524 arbitrary_resource1.filter = 47;
525 arbitrary_resource2.size = gfx::Size(89123, 23789); 525 arbitrary_resource2.size = gfx::Size(89123, 23789);
526 arbitrary_resource2.mailbox.setName(arbitrary_mailbox2); 526 arbitrary_resource2.mailbox.SetName(arbitrary_mailbox2);
527 527
528 DelegatedFrameData frame_in; 528 DelegatedFrameData frame_in;
529 frame_in.resource_list.push_back(arbitrary_resource1); 529 frame_in.resource_list.push_back(arbitrary_resource1);
530 frame_in.resource_list.push_back(arbitrary_resource2); 530 frame_in.resource_list.push_back(arbitrary_resource2);
531 531
532 IPC::ParamTraits<DelegatedFrameData>::Write(&msg, frame_in); 532 IPC::ParamTraits<DelegatedFrameData>::Write(&msg, frame_in);
533 533
534 DelegatedFrameData frame_out; 534 DelegatedFrameData frame_out;
535 PickleIterator iter(msg); 535 PickleIterator iter(msg);
536 EXPECT_TRUE(IPC::ParamTraits<DelegatedFrameData>::Read(&msg, 536 EXPECT_TRUE(IPC::ParamTraits<DelegatedFrameData>::Read(&msg,
537 &iter, &frame_out)); 537 &iter, &frame_out));
538 538
539 ASSERT_EQ(2u, frame_out.resource_list.size()); 539 ASSERT_EQ(2u, frame_out.resource_list.size());
540 Compare(arbitrary_resource1, frame_out.resource_list[0]); 540 Compare(arbitrary_resource1, frame_out.resource_list[0]);
541 Compare(arbitrary_resource2, frame_out.resource_list[1]); 541 Compare(arbitrary_resource2, frame_out.resource_list[1]);
542 } 542 }
543 543
544 } // namespace 544 } // namespace
545 } // namespace content 545 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698