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

Side by Side Diff: remoting/capturer/differ_block_unittest.cc

Issue 11470028: Move screen capturers to remoting/capturer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 "base/memory/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "remoting/host/differ_block.h" 6 #include "remoting/capturer/differ_block.h"
7 #include "testing/gmock/include/gmock/gmock.h" 7 #include "testing/gmock/include/gmock/gmock.h"
8 8
9 namespace remoting { 9 namespace remoting {
10 10
11 // Run 900 times to mimic 1280x720. 11 // Run 900 times to mimic 1280x720.
12 // TODO(fbarchard): Remove benchmark once performance is non-issue. 12 // TODO(fbarchard): Remove benchmark once performance is non-issue.
13 static const int kTimesToRun = 900; 13 static const int kTimesToRun = 900;
Wez 2012/12/11 05:23:18 We should follow up and move this out to a separat
14 14
15 static void GenerateData(uint8* data, int size) { 15 static void GenerateData(uint8* data, int size) {
16 for (int i = 0; i < size; ++i) { 16 for (int i = 0; i < size; ++i) {
17 data[i] = i; 17 data[i] = i;
18 } 18 }
19 } 19 }
20 20
21 // Memory buffer large enough for 2 blocks aligned to 16 bytes. 21 // Memory buffer large enough for 2 blocks aligned to 16 bytes.
22 static const int kSizeOfBlock = kBlockSize * kBlockSize * kBytesPerPixel; 22 static const int kSizeOfBlock = kBlockSize * kBlockSize * kBytesPerPixel;
23 uint8 block_buffer[kSizeOfBlock * 2 + 16]; 23 uint8 block_buffer[kSizeOfBlock * 2 + 16];
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 PrepareBuffers(block1, block2); 72 PrepareBuffers(block1, block2);
73 block2[0] += 1; 73 block2[0] += 1;
74 74
75 for (int i = 0; i < kTimesToRun; ++i) { 75 for (int i = 0; i < kTimesToRun; ++i) {
76 int result = BlockDifference(block1, block2, kBlockSize * kBytesPerPixel); 76 int result = BlockDifference(block1, block2, kBlockSize * kBytesPerPixel);
77 EXPECT_EQ(1, result); 77 EXPECT_EQ(1, result);
78 } 78 }
79 } 79 }
80 80
81 } // namespace remoting 81 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698