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 3 // found in the LICENSE file. 4 5 #include "chrome/browser/chromeos/version_loader.h" 6 7 #include <string> 8 9 #include "testing/gtest/include/gtest/gtest.h" 10 11 namespace chromeos { 12 13 typedef testing::Test VersionLoaderTest; 14 15 static const char kTest10[] = "vendor | FOO"; 16 static const char kTest11[] = "firmware | FOO"; 17 static const char kTest12[] = "firmware | FOO"; 18 static const char kTest13[] = "version | 0.2.3.3"; 19 static const char kTest14[] = "version | 0.2.3.3"; 20 static const char kTest15[] = "version 0.2.3.3"; 21 TEST_F(VersionLoaderTest,ParseFirmware)22TEST_F(VersionLoaderTest, ParseFirmware) { 23 EXPECT_EQ("", VersionLoader::ParseFirmware(kTest10)); 24 EXPECT_EQ("", VersionLoader::ParseFirmware(kTest11)); 25 EXPECT_EQ("", VersionLoader::ParseFirmware(kTest12)); 26 EXPECT_EQ("0.2.3.3", VersionLoader::ParseFirmware(kTest13)); 27 EXPECT_EQ("0.2.3.3", VersionLoader::ParseFirmware(kTest14)); 28 EXPECT_EQ("0.2.3.3", VersionLoader::ParseFirmware(kTest15)); 29 } 30 31 } // namespace chromeos 32