Revert "Merged all Chromoting Host code into remoting_core.dll (Windows)."
[chromium-blink-merge.git] / ui / webui / web_ui_util_unittest.cc
blob2c0ef4d837fb85503de126668f0023e019babfb5
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
3 // found in the LICENSE file.
5 #include "ui/webui/web_ui_util.h"
7 #include "googleurl/src/gurl.h"
8 #include "testing/gtest/include/gtest/gtest.h"
10 TEST(WebUIUtilTest, ParsePathAndScale) {
11 GURL url("http://some/random/username@email/and/more");
12 std::string path;
13 ui::ScaleFactor factor;
15 webui::ParsePathAndScale(url, &path, &factor);
16 EXPECT_EQ("random/username@email/and/more", path);
17 EXPECT_EQ(ui::SCALE_FACTOR_100P, factor);
19 GURL url2("http://some/random/username@email/and/more@2x");
20 webui::ParsePathAndScale(url2, &path, &factor);
21 EXPECT_EQ("random/username@email/and/more", path);
22 EXPECT_EQ(ui::SCALE_FACTOR_200P, factor);
24 GURL url3("http://some/random/username/and/more@2x");
25 webui::ParsePathAndScale(url3, &path, &factor);
26 EXPECT_EQ("random/username/and/more", path);
27 EXPECT_EQ(ui::SCALE_FACTOR_200P, factor);
29 GURL url4("http://some/random/username/and/more");
30 webui::ParsePathAndScale(url4, &path, &factor);
31 EXPECT_EQ("random/username/and/more", path);
32 EXPECT_EQ(ui::SCALE_FACTOR_100P, factor);