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

Side by Side Diff: chrome/browser/thumbnails/content_analysis_unittest.cc

Issue 13811056: Added variable initialization (valgrind complains). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed the nit. Created 7 years, 8 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 | « no previous file | no next file » | 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) 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 "chrome/browser/thumbnails/content_analysis.h" 5 #include "chrome/browser/thumbnails/content_analysis.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <cstdlib> 9 #include <cstdlib>
10 #include <limits> 10 #include <limits>
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 source, gfx::Size(424, 264), 2.5); 463 source, gfx::Size(424, 264), 2.5);
464 EXPECT_FALSE(result.empty()); 464 EXPECT_FALSE(result.empty());
465 465
466 // Given the nature of computation We can't really assert much here about the 466 // Given the nature of computation We can't really assert much here about the
467 // image itself. We know it should have been computed, should be smaller than 467 // image itself. We know it should have been computed, should be smaller than
468 // the original and it must not be zero. 468 // the original and it must not be zero.
469 EXPECT_LT(result.width(), image_size.width()); 469 EXPECT_LT(result.width(), image_size.width());
470 EXPECT_LT(result.height(), image_size.height()); 470 EXPECT_LT(result.height(), image_size.height());
471 // TODO(motek): this test is problematic/flaky on Win7. Investigate. 471 // TODO(motek): this test is problematic/flaky on Win7. Investigate.
472 #if !defined(OS_WIN) 472 #if !defined(OS_WIN)
473 int histogram[256]; 473 int histogram[256] = {};
474 color_utils::BuildLumaHistogram(result, histogram); 474 color_utils::BuildLumaHistogram(result, histogram);
475 int non_zero_color_count = std::count_if( 475 int non_zero_color_count = std::count_if(
476 histogram, histogram + 256, std::bind2nd(std::greater<int>(), 0)); 476 histogram, histogram + 256, std::bind2nd(std::greater<int>(), 0));
477 EXPECT_GT(non_zero_color_count, 4); 477 EXPECT_GT(non_zero_color_count, 4);
478 #endif // !defined(OS_WIN) 478 #endif // !defined(OS_WIN)
479 } 479 }
480 480
481 } // namespace thumbnailing_utils 481 } // namespace thumbnailing_utils
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698