| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/cros/onc_network_parser.h" | 5 #include "chrome/browser/chromeos/cros/onc_network_parser.h" |
| 6 | 6 |
| 7 #include <cert.h> | 7 #include <cert.h> |
| 8 #include <pk11pub.h> | 8 #include <pk11pub.h> |
| 9 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 if (!cert_db_.DeleteCertAndKey(certs[i])) | 80 if (!cert_db_.DeleteCertAndKey(certs[i])) |
| 81 ok = false; | 81 ok = false; |
| 82 } | 82 } |
| 83 return ok; | 83 return ok; |
| 84 } | 84 } |
| 85 | 85 |
| 86 static base::LazyInstance<ScopedTempDir> temp_db_dir_; | 86 static base::LazyInstance<ScopedTempDir> temp_db_dir_; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 // static | 89 // static |
| 90 base::LazyInstance<ScopedTempDir> OncNetworkParserTest::temp_db_dir_( | 90 base::LazyInstance<ScopedTempDir> OncNetworkParserTest::temp_db_dir_ = |
| 91 base::LINKER_INITIALIZED); | 91 LINKER_ZERO_INITIALIZED; |
| 92 | 92 |
| 93 TEST_F(OncNetworkParserTest, TestCreateNetworkWifi1) { | 93 TEST_F(OncNetworkParserTest, TestCreateNetworkWifi1) { |
| 94 std::string test_blob( | 94 std::string test_blob( |
| 95 "{" | 95 "{" |
| 96 " \"NetworkConfigurations\": [{" | 96 " \"NetworkConfigurations\": [{" |
| 97 " \"GUID\": \"{485d6076-dd44-6b6d-69787465725f5045}\"," | 97 " \"GUID\": \"{485d6076-dd44-6b6d-69787465725f5045}\"," |
| 98 " \"Type\": \"WiFi\"," | 98 " \"Type\": \"WiFi\"," |
| 99 " \"WiFi\": {" | 99 " \"WiFi\": {" |
| 100 " \"Security\": \"WEP\"," | 100 " \"Security\": \"WEP\"," |
| 101 " \"SSID\": \"ssid\"," | 101 " \"SSID\": \"ssid\"," |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 " }" | 298 " }" |
| 299 " ]," | 299 " ]," |
| 300 "}"); | 300 "}"); |
| 301 OncNetworkParser parser(test_blob); | 301 OncNetworkParser parser(test_blob); |
| 302 | 302 |
| 303 EXPECT_EQ(1, parser.GetCertificatesSize()); | 303 EXPECT_EQ(1, parser.GetCertificatesSize()); |
| 304 EXPECT_TRUE(parser.ParseCertificate(0)); | 304 EXPECT_TRUE(parser.ParseCertificate(0)); |
| 305 } | 305 } |
| 306 | 306 |
| 307 } // namespace chromeos | 307 } // namespace chromeos |
| OLD | NEW |