OLD | NEW |
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 namespace UnitTests | 5 namespace UnitTests |
6 { | 6 { |
7 using System; | 7 using System; |
8 using System.IO; | 8 using System.IO; |
9 | 9 |
10 using EnvDTE; | 10 using EnvDTE; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 /// <summary> | 94 /// <summary> |
95 /// Tests SetTarget() and SetTargetToActive(). | 95 /// Tests SetTarget() and SetTargetToActive(). |
96 /// </summary> | 96 /// </summary> |
97 [TestMethod] | 97 [TestMethod] |
98 public void SetTargetTest() | 98 public void SetTargetTest() |
99 { | 99 { |
100 string expectedSDKRootDir = | 100 string expectedSDKRootDir = |
101 Environment.GetEnvironmentVariable(Strings.SDKPathEnvironmentVariable)
; | 101 Environment.GetEnvironmentVariable(Strings.SDKPathEnvironmentVariable)
; |
102 Assert.IsNotNull(expectedSDKRootDir, "SDK Path environment variable not se
t!"); | 102 Assert.IsNotNull(expectedSDKRootDir, "SDK Path environment variable not se
t!"); |
| 103 expectedSDKRootDir = expectedSDKRootDir.TrimEnd(new char[] { '/', '\\' }); |
103 | 104 |
104 PropertyManager target = new PropertyManager(); | 105 PropertyManager target = new PropertyManager(); |
105 dte_.Solution.Open(naclSolution); | 106 dte_.Solution.Open(naclSolution); |
106 | 107 |
107 Project naclProject = dte_.Solution.Projects.Item(TestUtilities.BlankNaClP
rojectUniqueName); | 108 Project naclProject = dte_.Solution.Projects.Item(TestUtilities.BlankNaClP
rojectUniqueName); |
108 Project notNacl = dte_.Solution.Projects.Item(TestUtilities.NotNaClProject
UniqueName); | 109 Project notNacl = dte_.Solution.Projects.Item(TestUtilities.NotNaClProject
UniqueName); |
109 | 110 |
110 // Invalid project. | 111 // Invalid project. |
111 target.SetTarget(notNacl, Strings.PepperPlatformName, "Debug"); | 112 target.SetTarget(notNacl, Strings.PepperPlatformName, "Debug"); |
112 Assert.AreEqual( | 113 Assert.AreEqual( |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 170 |
170 /// <summary> | 171 /// <summary> |
171 /// A test for GetProperty. Checks some non-trivial C# properties and the Ge
tProperty method. | 172 /// A test for GetProperty. Checks some non-trivial C# properties and the Ge
tProperty method. |
172 /// </summary> | 173 /// </summary> |
173 [TestMethod] | 174 [TestMethod] |
174 public void GetPropertyTest() | 175 public void GetPropertyTest() |
175 { | 176 { |
176 string expectedSDKRootDir = | 177 string expectedSDKRootDir = |
177 Environment.GetEnvironmentVariable(Strings.SDKPathEnvironmentVariable)
; | 178 Environment.GetEnvironmentVariable(Strings.SDKPathEnvironmentVariable)
; |
178 Assert.IsNotNull(expectedSDKRootDir, "SDK Path environment variable not se
t!"); | 179 Assert.IsNotNull(expectedSDKRootDir, "SDK Path environment variable not se
t!"); |
| 180 expectedSDKRootDir = expectedSDKRootDir.TrimEnd(new char[] { '/', '\\' }); |
179 | 181 |
180 // Set up the property manager to read the NaCl platform settings from Bla
nkValidSolution. | 182 // Set up the property manager to read the NaCl platform settings from Bla
nkValidSolution. |
181 PropertyManager target = new PropertyManager(); | 183 PropertyManager target = new PropertyManager(); |
182 dte_.Solution.Open(naclSolution); | 184 dte_.Solution.Open(naclSolution); |
183 Project naclProject = dte_.Solution.Projects.Item(TestUtilities.BlankNaClP
rojectUniqueName); | 185 Project naclProject = dte_.Solution.Projects.Item(TestUtilities.BlankNaClP
rojectUniqueName); |
184 target.SetTarget(naclProject, Strings.NaClPlatformName, "Debug"); | 186 target.SetTarget(naclProject, Strings.NaClPlatformName, "Debug"); |
185 Assert.AreEqual( | 187 Assert.AreEqual( |
186 PropertyManager.ProjectPlatformType.NaCl, | 188 PropertyManager.ProjectPlatformType.NaCl, |
187 target.ProjectPlatform, | 189 target.ProjectPlatform, |
188 "SetTarget did not succeed with nacl platform on valid project."); | 190 "SetTarget did not succeed with nacl platform on valid project."); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 | 230 |
229 string newValue = "ThisIsNew"; | 231 string newValue = "ThisIsNew"; |
230 target.SetProperty("ConfigurationGeneral", "VSNaClSDKRoot", newValue); | 232 target.SetProperty("ConfigurationGeneral", "VSNaClSDKRoot", newValue); |
231 Assert.AreEqual( | 233 Assert.AreEqual( |
232 newValue, | 234 newValue, |
233 target.GetProperty("ConfigurationGeneral", "VSNaClSDKRoot"), | 235 target.GetProperty("ConfigurationGeneral", "VSNaClSDKRoot"), |
234 "SetProperty() did not set property VSNaClSDKRoot."); | 236 "SetProperty() did not set property VSNaClSDKRoot."); |
235 } | 237 } |
236 } | 238 } |
237 } | 239 } |
OLD | NEW |