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

Side by Side Diff: views/controls/progress_bar_unittest.cc

Issue 6192007: Remove wstring from views. Part 3: Switch accessibility strings to string16.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | « views/controls/menu/submenu_view.cc ('k') | views/controls/tabbed_pane/tabbed_pane.cc » ('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 "base/string_util.h" 5 #include "base/string_util.h"
6 #include "base/utf_string_conversions.h"
6 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
7 #include "views/controls/progress_bar.h" 8 #include "views/controls/progress_bar.h"
8 9
9 namespace views { 10 namespace views {
10 11
11 TEST(ProgressBarTest, ProgressProperty) { 12 TEST(ProgressBarTest, ProgressProperty) {
12 ProgressBar bar; 13 ProgressBar bar;
13 bar.SetProgress(-1); 14 bar.SetProgress(-1);
14 int progress = bar.GetProgress(); 15 int progress = bar.GetProgress();
15 EXPECT_EQ(0, progress); 16 EXPECT_EQ(0, progress);
(...skipping 26 matching lines...) Expand all
42 EXPECT_TRUE(bar.GetTooltipText(gfx::Point(), &tooltip)); 43 EXPECT_TRUE(bar.GetTooltipText(gfx::Point(), &tooltip));
43 EXPECT_EQ(tooltip_text, tooltip); 44 EXPECT_EQ(tooltip_text, tooltip);
44 } 45 }
45 46
46 TEST(ProgressBarTest, Accessibility) { 47 TEST(ProgressBarTest, Accessibility) {
47 ProgressBar bar; 48 ProgressBar bar;
48 bar.SetProgress(62); 49 bar.SetProgress(62);
49 50
50 EXPECT_EQ(AccessibilityTypes::ROLE_PROGRESSBAR, bar.GetAccessibleRole()); 51 EXPECT_EQ(AccessibilityTypes::ROLE_PROGRESSBAR, bar.GetAccessibleRole());
51 52
52 std::wstring name; 53 string16 name;
53 EXPECT_FALSE(bar.GetAccessibleName(&name)); 54 EXPECT_FALSE(bar.GetAccessibleName(&name));
54 EXPECT_EQ(std::wstring(), name); 55 EXPECT_EQ(string16(), name);
55 std::wstring accessible_name = L"My progress bar"; 56 string16 accessible_name = ASCIIToUTF16("My progress bar");
56 bar.SetAccessibleName(accessible_name); 57 bar.SetAccessibleName(accessible_name);
57 EXPECT_TRUE(bar.GetAccessibleName(&name)); 58 EXPECT_TRUE(bar.GetAccessibleName(&name));
58 EXPECT_EQ(accessible_name, name); 59 EXPECT_EQ(accessible_name, name);
59 60
60 EXPECT_TRUE(AccessibilityTypes::STATE_READONLY & bar.GetAccessibleState()); 61 EXPECT_TRUE(AccessibilityTypes::STATE_READONLY & bar.GetAccessibleState());
61 } 62 }
62 63
63 } // namespace views 64 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/menu/submenu_view.cc ('k') | views/controls/tabbed_pane/tabbed_pane.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698