| 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.Diagnostics; | 8 using System.Diagnostics; |
| 9 using System.IO; | 9 using System.IO; |
| 10 using System.Reflection; | 10 using System.Reflection; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 /// <summary> | 70 /// <summary> |
| 71 /// This is run before each test to create test resources. | 71 /// This is run before each test to create test resources. |
| 72 /// </summary> | 72 /// </summary> |
| 73 [TestInitialize] | 73 [TestInitialize] |
| 74 public void TestSetup() | 74 public void TestSetup() |
| 75 { | 75 { |
| 76 dte_ = TestUtilities.StartVisualStudioInstance(); | 76 dte_ = TestUtilities.StartVisualStudioInstance(); |
| 77 try |
| 78 { |
| 79 TestUtilities.AssertAddinLoaded(dte_, NativeClientVSAddIn.Strings.AddInN
ame); |
| 80 } |
| 81 catch |
| 82 { |
| 83 TestUtilities.CleanUpVisualStudioInstance(dte_); |
| 84 throw; |
| 85 } |
| 77 } | 86 } |
| 78 | 87 |
| 79 /// <summary> | 88 /// <summary> |
| 80 /// This is run after each test to clean up things created in TestSetup(). | 89 /// This is run after each test to clean up things created in TestSetup(). |
| 81 /// </summary> | 90 /// </summary> |
| 82 [TestCleanup] | 91 [TestCleanup] |
| 83 public void TestCleanup() | 92 public void TestCleanup() |
| 84 { | 93 { |
| 85 TestUtilities.CleanUpVisualStudioInstance(dte_); | 94 TestUtilities.CleanUpVisualStudioInstance(dte_); |
| 86 } | 95 } |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 227 |
| 219 target.pluginAssembly_ = "testAssemblyPath"; | 228 target.pluginAssembly_ = "testAssemblyPath"; |
| 220 string pluginLoadFlag = string.Format( | 229 string pluginLoadFlag = string.Format( |
| 221 Strings.PepperProcessPluginFlagFormat, target.pluginAssembly_); | 230 Strings.PepperProcessPluginFlagFormat, target.pluginAssembly_); |
| 222 string pepperCommandLine = string.Concat( | 231 string pepperCommandLine = string.Concat( |
| 223 pluginLoadFlag, " ", Strings.ChromeRendererFlag); | 232 pluginLoadFlag, " ", Strings.ChromeRendererFlag); |
| 224 | 233 |
| 225 // Fake the list of processes on the system. | 234 // Fake the list of processes on the system. |
| 226 processResults.ProcessList.Add( | 235 processResults.ProcessList.Add( |
| 227 new ProcessInfo( | 236 new ProcessInfo( |
| 228 currentProcId, currentProcId, string.Empty, string.Empty, Strings.
ChromeProcessName)); | 237 currentProcId, |
| 238 currentProcId, |
| 239 string.Empty, |
| 240 Strings.NaClDebugFlag, |
| 241 Strings.ChromeProcessName)); |
| 229 processResults.ProcessList.Add( | 242 processResults.ProcessList.Add( |
| 230 new ProcessInfo(1, currentProcId, string.Empty, string.Empty, "MyParen
tProcess")); | 243 new ProcessInfo(1, currentProcId, string.Empty, string.Empty, "MyParen
tProcess")); |
| 231 processResults.ProcessList.Add( | 244 processResults.ProcessList.Add( |
| 232 new ProcessInfo(10, 1, string.Empty, pepperCommandLine, Strings.Chrome
ProcessName)); | 245 new ProcessInfo(10, 1, string.Empty, pepperCommandLine, Strings.Chrome
ProcessName)); |
| 233 processResults.ProcessList.Add( | 246 processResults.ProcessList.Add( |
| 234 new ProcessInfo(11, 1, string.Empty, naclCommandLine, Strings.NaClProc
essName)); | 247 new ProcessInfo(11, 1, string.Empty, naclCommandLine, Strings.NaClProc
essName)); |
| 235 | 248 |
| 236 // These two are missing some relevant command line args, they should not
be attached to. | 249 // These two are missing some relevant command line args, they should not
be attached to. |
| 237 processResults.ProcessList.Add( | 250 processResults.ProcessList.Add( |
| 238 new ProcessInfo(12, 1, string.Empty, pluginLoadFlag, Strings.ChromePro
cessName)); | 251 new ProcessInfo(12, 1, string.Empty, pluginLoadFlag, Strings.ChromePro
cessName)); |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 } | 636 } |
| 624 | 637 |
| 625 System.Threading.Thread.Sleep(500); | 638 System.Threading.Thread.Sleep(500); |
| 626 result = TestUtilities.GetPaneText(target.webServerOutputPane_); | 639 result = TestUtilities.GetPaneText(target.webServerOutputPane_); |
| 627 } | 640 } |
| 628 | 641 |
| 629 StringAssert.Contains(result, successMessage, "Message failed to print"); | 642 StringAssert.Contains(result, successMessage, "Message failed to print"); |
| 630 } | 643 } |
| 631 } | 644 } |
| 632 } | 645 } |
| OLD | NEW |