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

Side by Side Diff: ui/views/controls/label_unittest.cc

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Sync with ToT Created 3 years, 4 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
« no previous file with comments | « ui/views/cocoa/bridged_native_widget.mm ('k') | ui/views/controls/menu/submenu_view.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) 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 "ui/views/controls/label.h" 5 #include "ui/views/controls/label.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 class TestLabel : public Label { 50 class TestLabel : public Label {
51 public: 51 public:
52 TestLabel() : Label(ASCIIToUTF16("TestLabel")) { SizeToPreferredSize(); } 52 TestLabel() : Label(ASCIIToUTF16("TestLabel")) { SizeToPreferredSize(); }
53 53
54 int schedule_paint_count() const { return schedule_paint_count_; } 54 int schedule_paint_count() const { return schedule_paint_count_; }
55 55
56 void SimulatePaint() { 56 void SimulatePaint() {
57 SkBitmap bitmap; 57 SkBitmap bitmap;
58 SkColor color = SK_ColorTRANSPARENT; 58 SkColor color = SK_ColorTRANSPARENT;
59 Paint(ui::CanvasPainter(&bitmap, bounds().size(), 1.f, color).context()); 59 Paint(PaintInfo::CreateRootPaintInfo(
60 ui::CanvasPainter(&bitmap, bounds().size(), 1.f, color, false)
61 .context(),
62 bounds().size()));
60 } 63 }
61 64
62 // View: 65 // View:
63 void SchedulePaintInRect(const gfx::Rect& r) override { 66 void SchedulePaintInRect(const gfx::Rect& r) override {
64 ++schedule_paint_count_; 67 ++schedule_paint_count_;
65 Label::SchedulePaintInRect(r); 68 Label::SchedulePaintInRect(r);
66 } 69 }
67 70
68 private: 71 private:
69 int schedule_paint_count_ = 0; 72 int schedule_paint_count_ = 0;
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 EXPECT_FALSE(IsMenuCommandEnabled(IDS_APP_SELECT_ALL)); 1324 EXPECT_FALSE(IsMenuCommandEnabled(IDS_APP_SELECT_ALL));
1322 } 1325 }
1323 1326
1324 INSTANTIATE_TEST_CASE_P(, 1327 INSTANTIATE_TEST_CASE_P(,
1325 MDLabelTest, 1328 MDLabelTest,
1326 ::testing::Values(SecondaryUiMode::MD, 1329 ::testing::Values(SecondaryUiMode::MD,
1327 SecondaryUiMode::NON_MD), 1330 SecondaryUiMode::NON_MD),
1328 &SecondaryUiModeToString); 1331 &SecondaryUiModeToString);
1329 1332
1330 } // namespace views 1333 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/cocoa/bridged_native_widget.mm ('k') | ui/views/controls/menu/submenu_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698