1 // Copyright 2014 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. 4 5 #include "ui/display/chromeos/x11/display_util_x11.h" 6 7 #include "base/memory/scoped_ptr.h" 8 #include "testing/gtest/include/gtest/gtest.h" 9 10 namespace ui { 11 12 TEST(DisplayUtilX11Test, GetDisplayConnectionTypeFromName) { 13 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_INTERNAL, 14 GetDisplayConnectionTypeFromName("LVDS")); 15 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_INTERNAL, 16 GetDisplayConnectionTypeFromName("eDP")); 17 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_INTERNAL, 18 GetDisplayConnectionTypeFromName("DSI")); 19 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_INTERNAL, 20 GetDisplayConnectionTypeFromName("LVDSxx")); 21 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_INTERNAL, 22 GetDisplayConnectionTypeFromName("eDPzz")); 23 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_INTERNAL, 24 GetDisplayConnectionTypeFromName("DSIyy")); 25 26 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_VGA, 27 GetDisplayConnectionTypeFromName("VGA")); 28 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_VGA, 29 GetDisplayConnectionTypeFromName("VGAxx")); 30 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_HDMI, 31 GetDisplayConnectionTypeFromName("HDMI")); 32 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_HDMI, 33 GetDisplayConnectionTypeFromName("HDMIyy")); 34 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_DVI, 35 GetDisplayConnectionTypeFromName("DVI")); 36 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_DVI, 37 GetDisplayConnectionTypeFromName("DVIzz")); 38 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_DISPLAYPORT, 39 GetDisplayConnectionTypeFromName("DP")); 40 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_DISPLAYPORT, 41 GetDisplayConnectionTypeFromName("DPww")); 42 43 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_UNKNOWN, 44 GetDisplayConnectionTypeFromName("xyz")); 45 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_UNKNOWN, 46 GetDisplayConnectionTypeFromName("abcLVDS")); 47 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_UNKNOWN, 48 GetDisplayConnectionTypeFromName("cdeeDP")); 49 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_UNKNOWN, 50 GetDisplayConnectionTypeFromName("abcDSI")); 51 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_UNKNOWN, 52 GetDisplayConnectionTypeFromName("LVD")); 53 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_UNKNOWN, 54 GetDisplayConnectionTypeFromName("eD")); 55 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_UNKNOWN, 56 GetDisplayConnectionTypeFromName("DS")); 57 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_UNKNOWN, 58 GetDisplayConnectionTypeFromName("VG")); 59 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_UNKNOWN, 60 GetDisplayConnectionTypeFromName("HDM")); 61 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_UNKNOWN, 62 GetDisplayConnectionTypeFromName("DV")); 63 EXPECT_EQ(DISPLAY_CONNECTION_TYPE_UNKNOWN, 64 GetDisplayConnectionTypeFromName("D")); 65 } 66 67 } // namespace ui 68