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

Side by Side Diff: chrome/browser/ui/webui/web_ui_util_unittest.cc

Issue 11301007: Load the resources for max scale factor first. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | « chrome/browser/ui/webui/web_ui_util.cc ('k') | ui/base/layout.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 "chrome/browser/ui/webui/web_ui_util.h" 5 #include "chrome/browser/ui/webui/web_ui_util.h"
6 6
7 #include "googleurl/src/gurl.h" 7 #include "googleurl/src/gurl.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 TEST(WebUIUtilTest, ParsePathAndScale) { 10 TEST(WebUIUtilTest, ParsePathAndScale) {
11 GURL url("chrome://some/random/username@email/and/more"); 11 GURL url("chrome://some/random/username@email/and/more");
12 std::string path; 12 std::string path;
13 ui::ScaleFactor factor; 13 ui::ScaleFactor factor;
14 14
15 web_ui_util::ParsePathAndScale(url, &path, &factor); 15 web_ui_util::ParsePathAndScale(url, &path, &factor);
16 EXPECT_EQ("random/username@email/and/more", path); 16 EXPECT_EQ("random/username@email/and/more", path);
17 EXPECT_EQ(ui::SCALE_FACTOR_NONE, factor); 17 EXPECT_EQ(ui::SCALE_FACTOR_100P, factor);
18 18
19 GURL url2("chrome://some/random/username@email/and/more@2x"); 19 GURL url2("chrome://some/random/username@email/and/more@2x");
20 web_ui_util::ParsePathAndScale(url2, &path, &factor); 20 web_ui_util::ParsePathAndScale(url2, &path, &factor);
21 EXPECT_EQ("random/username@email/and/more", path); 21 EXPECT_EQ("random/username@email/and/more", path);
22 EXPECT_EQ(ui::SCALE_FACTOR_200P, factor); 22 EXPECT_EQ(ui::SCALE_FACTOR_200P, factor);
23 23
24 GURL url3("chrome://some/random/username/and/more@2x"); 24 GURL url3("chrome://some/random/username/and/more@2x");
25 web_ui_util::ParsePathAndScale(url3, &path, &factor); 25 web_ui_util::ParsePathAndScale(url3, &path, &factor);
26 EXPECT_EQ("random/username/and/more", path); 26 EXPECT_EQ("random/username/and/more", path);
27 EXPECT_EQ(ui::SCALE_FACTOR_200P, factor); 27 EXPECT_EQ(ui::SCALE_FACTOR_200P, factor);
28 28
29 GURL url4("chrome://some/random/username/and/more"); 29 GURL url4("chrome://some/random/username/and/more");
30 web_ui_util::ParsePathAndScale(url4, &path, &factor); 30 web_ui_util::ParsePathAndScale(url4, &path, &factor);
31 EXPECT_EQ("random/username/and/more", path); 31 EXPECT_EQ("random/username/and/more", path);
32 EXPECT_EQ(ui::SCALE_FACTOR_NONE, factor); 32 EXPECT_EQ(ui::SCALE_FACTOR_100P, factor);
33 } 33 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/web_ui_util.cc ('k') | ui/base/layout.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698