Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

Commit 2f31194

Browse files
author
N. Taylor Mullen
committed
Rebased.
- Tests updated to utilize new instrumentation.
1 parent e50856d commit 2f31194

File tree

6 files changed

+73
-0
lines changed

6 files changed

+73
-0
lines changed

test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/BasicTagHelpers.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma checksum "BasicTagHelpers.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "8d60e58d54168749dc71a0d6d3a95887b2adb5e7"
12
namespace TestOutput
23
{
34
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
@@ -21,22 +22,28 @@ public BasicTagHelpers()
2122
#pragma warning disable 1998
2223
public override async Task ExecuteAsync()
2324
{
25+
Instrumentation.BeginContext(0, 47, true);
2426
WriteLiteral("<div class=\"randomNonTagHelperAttribute\">\r\n ");
27+
Instrumentation.EndContext();
2528
__tagHelpersExecutionContext = __tagHelperScopeManager.Begin("p");
2629
__PTagHelper = CreateTagHelper<PTagHelper>();
2730
__tagHelpersExecutionContext.Add(__PTagHelper);
2831
__tagHelpersExecutionContext.AddHtmlAttribute("class", "Hello World");
2932
__tagHelpersExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelpersExecutionContext).Result;
3033
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateStartTag());
34+
Instrumentation.BeginContext(70, 10, true);
3135
WriteLiteral("\r\n ");
36+
Instrumentation.EndContext();
3237
__tagHelpersExecutionContext = __tagHelperScopeManager.Begin("p");
3338
__PTagHelper = CreateTagHelper<PTagHelper>();
3439
__tagHelpersExecutionContext.Add(__PTagHelper);
3540
__tagHelpersExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelpersExecutionContext).Result;
3641
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateStartTag());
3742
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateEndTag());
3843
__tagHelpersExecutionContext = __tagHelperScopeManager.End();
44+
Instrumentation.BeginContext(87, 10, true);
3945
WriteLiteral("\r\n ");
46+
Instrumentation.EndContext();
4047
__tagHelpersExecutionContext = __tagHelperScopeManager.Begin("input");
4148
__InputTagHelper = CreateTagHelper<InputTagHelper>();
4249
__tagHelpersExecutionContext.Add(__InputTagHelper);
@@ -49,7 +56,9 @@ public override async Task ExecuteAsync()
4956
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateStartTag());
5057
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateEndTag());
5158
__tagHelpersExecutionContext = __tagHelperScopeManager.End();
59+
Instrumentation.BeginContext(118, 10, true);
5260
WriteLiteral("\r\n ");
61+
Instrumentation.EndContext();
5362
__tagHelpersExecutionContext = __tagHelperScopeManager.Begin("input");
5463
__InputTagHelper = CreateTagHelper<InputTagHelper>();
5564
__tagHelpersExecutionContext.Add(__InputTagHelper);
@@ -64,10 +73,14 @@ public override async Task ExecuteAsync()
6473
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateStartTag());
6574
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateEndTag());
6675
__tagHelpersExecutionContext = __tagHelperScopeManager.End();
76+
Instrumentation.BeginContext(167, 6, true);
6777
WriteLiteral("\r\n ");
78+
Instrumentation.EndContext();
6879
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateEndTag());
6980
__tagHelpersExecutionContext = __tagHelperScopeManager.End();
81+
Instrumentation.BeginContext(177, 8, true);
7082
WriteLiteral("\r\n</div>");
83+
Instrumentation.EndContext();
7184
}
7285
#pragma warning restore 1998
7386
}

test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/ComplexTagHelpers.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma checksum "ComplexTagHelpers.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "7540f76029963ad4e3c0a02077a63d0fe2cb0157"
12
namespace TestOutput
23
{
34
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
@@ -30,7 +31,9 @@ public override async Task ExecuteAsync()
3031
#line default
3132
#line hidden
3233

34+
Instrumentation.BeginContext(49, 55, true);
3335
WriteLiteral(" <div class=\"randomNonTagHelperAttribute\">\r\n ");
36+
Instrumentation.EndContext();
3437
__tagHelpersExecutionContext = __tagHelperScopeManager.Begin("p");
3538
__PTagHelper = CreateTagHelper<PTagHelper>();
3639
__tagHelpersExecutionContext.Add(__PTagHelper);
@@ -48,7 +51,9 @@ public override async Task ExecuteAsync()
4851
__tagHelpersExecutionContext.AddHtmlAttribute("time", __tagHelperStringValueBuffer.ToString());
4952
__tagHelpersExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelpersExecutionContext).Result;
5053
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateStartTag());
54+
Instrumentation.BeginContext(142, 34, true);
5155
WriteLiteral("\r\n <h1>Set Time:</h1>\r\n");
56+
Instrumentation.EndContext();
5257
#line 8 "ComplexTagHelpers.cshtml"
5358

5459

@@ -62,13 +67,17 @@ public override async Task ExecuteAsync()
6267
#line default
6368
#line hidden
6469

70+
Instrumentation.BeginContext(216, 16, true);
6571
WriteLiteral(" ");
72+
Instrumentation.EndContext();
6673
__tagHelpersExecutionContext = __tagHelperScopeManager.Begin("p");
6774
__PTagHelper = CreateTagHelper<PTagHelper>();
6875
__tagHelpersExecutionContext.Add(__PTagHelper);
6976
__tagHelpersExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelpersExecutionContext).Result;
7077
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateStartTag());
78+
Instrumentation.BeginContext(235, 10, true);
7179
WriteLiteral("New Time: ");
80+
Instrumentation.EndContext();
7281
__tagHelpersExecutionContext = __tagHelperScopeManager.Begin("input");
7382
__InputTagHelper = CreateTagHelper<InputTagHelper>();
7483
__tagHelpersExecutionContext.Add(__InputTagHelper);
@@ -85,7 +94,9 @@ public override async Task ExecuteAsync()
8594
__tagHelpersExecutionContext = __tagHelperScopeManager.End();
8695
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateEndTag());
8796
__tagHelpersExecutionContext = __tagHelperScopeManager.End();
97+
Instrumentation.BeginContext(315, 2, true);
8898
WriteLiteral("\r\n");
99+
Instrumentation.EndContext();
89100
#line 11 "ComplexTagHelpers.cshtml"
90101
}
91102
else
@@ -94,13 +105,17 @@ public override async Task ExecuteAsync()
94105
#line default
95106
#line hidden
96107

108+
Instrumentation.BeginContext(365, 16, true);
97109
WriteLiteral(" ");
110+
Instrumentation.EndContext();
98111
__tagHelpersExecutionContext = __tagHelperScopeManager.Begin("p");
99112
__PTagHelper = CreateTagHelper<PTagHelper>();
100113
__tagHelpersExecutionContext.Add(__PTagHelper);
101114
__tagHelpersExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelpersExecutionContext).Result;
102115
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateStartTag());
116+
Instrumentation.BeginContext(384, 14, true);
103117
WriteLiteral("Current Time: ");
118+
Instrumentation.EndContext();
104119
__tagHelpersExecutionContext = __tagHelperScopeManager.Begin("input");
105120
__InputTagHelper = CreateTagHelper<InputTagHelper>();
106121
__tagHelpersExecutionContext.Add(__InputTagHelper);
@@ -127,7 +142,9 @@ public override async Task ExecuteAsync()
127142
__tagHelpersExecutionContext = __tagHelperScopeManager.End();
128143
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateEndTag());
129144
__tagHelpersExecutionContext = __tagHelperScopeManager.End();
145+
Instrumentation.BeginContext(439, 18, true);
130146
WriteLiteral("\r\n ");
147+
Instrumentation.EndContext();
131148
__tagHelpersExecutionContext = __tagHelperScopeManager.Begin("input");
132149
__InputTagHelper = CreateTagHelper<InputTagHelper>();
133150
__tagHelpersExecutionContext.Add(__InputTagHelper);
@@ -150,7 +167,9 @@ public override async Task ExecuteAsync()
150167
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateStartTag());
151168
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateEndTag());
152169
__tagHelpersExecutionContext = __tagHelperScopeManager.End();
170+
Instrumentation.BeginContext(507, 18, true);
153171
WriteLiteral("\r\n ");
172+
Instrumentation.EndContext();
154173
__tagHelpersExecutionContext = __tagHelperScopeManager.Begin("input");
155174
__InputTagHelper = CreateTagHelper<InputTagHelper>();
156175
__tagHelpersExecutionContext.Add(__InputTagHelper);
@@ -185,17 +204,23 @@ public override async Task ExecuteAsync()
185204
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateStartTag());
186205
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateEndTag());
187206
__tagHelpersExecutionContext = __tagHelperScopeManager.End();
207+
Instrumentation.BeginContext(608, 2, true);
188208
WriteLiteral("\r\n");
209+
Instrumentation.EndContext();
189210
#line 17 "ComplexTagHelpers.cshtml"
190211
}
191212

192213
#line default
193214
#line hidden
194215

216+
Instrumentation.BeginContext(625, 8, true);
195217
WriteLiteral(" ");
218+
Instrumentation.EndContext();
196219
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateEndTag());
197220
__tagHelpersExecutionContext = __tagHelperScopeManager.End();
221+
Instrumentation.BeginContext(637, 14, true);
198222
WriteLiteral("\r\n </div>\r\n");
223+
Instrumentation.EndContext();
199224
#line 20 "ComplexTagHelpers.cshtml"
200225
}
201226

test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/ContentBehaviorTagHelpers.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma checksum "ContentBehaviorTagHelpers.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "27af4f673a178e8b27e320ea0d869aaf6a16a18b"
12
namespace TestOutput
23
{
34
using Microsoft.AspNet.Razor.Runtime.TagHelpers;

test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/SingleTagHelper.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma checksum "SingleTagHelper.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "2c9b5f2ce383fe784f68f84cbb669ab04077c417"
12
namespace TestOutput
23
{
34
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
@@ -27,7 +28,9 @@ public override async Task ExecuteAsync()
2728
__tagHelpersExecutionContext.AddHtmlAttribute("class", "Hello World");
2829
__tagHelpersExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelpersExecutionContext).Result;
2930
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateStartTag());
31+
Instrumentation.BeginContext(34, 11, true);
3032
WriteLiteral("Body of Tag");
33+
Instrumentation.EndContext();
3134
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateEndTag());
3235
__tagHelpersExecutionContext = __tagHelperScopeManager.End();
3336
}

test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/TagHelpersInHelper.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma checksum "TagHelpersInHelper.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "522348d1a7650330b24372fade70f418f61027bd"
12
namespace TestOutput
23
{
34
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
@@ -11,6 +12,7 @@ public class TagHelpersInHelper
1112
private TagHelperRunner __tagHelperRunner = new TagHelperRunner();
1213
private TagHelperScopeManager __tagHelperScopeManager = new TagHelperScopeManager();
1314
private MyTagHelper __MyTagHelper = null;
15+
private NestedTagHelper __NestedTagHelper = null;
1416
public static Template
1517
#line 1 "TagHelpersInHelper.cshtml"
1618
MyHelper(string val)
@@ -25,7 +27,9 @@ public static Template
2527
#line default
2628
#line hidden
2729

30+
Instrumentation.BeginContext(33, 19, true);
2831
WriteLiteralTo(__razor_helper_writer, " <div>\r\n ");
32+
Instrumentation.EndContext();
2933
__tagHelpersExecutionContext = __tagHelperScopeManager.Begin("mytaghelper");
3034
__MyTagHelper = CreateTagHelper<MyTagHelper>();
3135
__tagHelpersExecutionContext.Add(__MyTagHelper);
@@ -56,7 +60,9 @@ public static Template
5660
__tagHelpersExecutionContext.AddHtmlAttribute("unboundproperty", __tagHelperStringValueBuffer.ToString());
5761
__tagHelpersExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelpersExecutionContext).Result;
5862
WriteLiteralTo(__razor_helper_writer, __tagHelpersExecutionContext.Output.GenerateStartTag());
63+
Instrumentation.BeginContext(155, 52, true);
5964
WriteLiteralTo(__razor_helper_writer, "\r\n In None ContentBehavior.\r\n ");
65+
Instrumentation.EndContext();
6066
__tagHelpersExecutionContext = __tagHelperScopeManager.Begin("nestedtaghelper");
6167
__NestedTagHelper = CreateTagHelper<NestedTagHelper>();
6268
__tagHelpersExecutionContext.Add(__NestedTagHelper);
@@ -76,10 +82,14 @@ public static Template
7682
WriteLiteralTo(__razor_helper_writer, __tagHelpersExecutionContext.Output.GenerateContent());
7783
WriteLiteralTo(__razor_helper_writer, __tagHelpersExecutionContext.Output.GenerateEndTag());
7884
__tagHelpersExecutionContext = __tagHelperScopeManager.End();
85+
Instrumentation.BeginContext(283, 10, true);
7986
WriteLiteralTo(__razor_helper_writer, "\r\n ");
87+
Instrumentation.EndContext();
8088
WriteLiteralTo(__razor_helper_writer, __tagHelpersExecutionContext.Output.GenerateEndTag());
8189
__tagHelpersExecutionContext = __tagHelperScopeManager.End();
90+
Instrumentation.BeginContext(307, 14, true);
8291
WriteLiteralTo(__razor_helper_writer, "\r\n </div>\r\n");
92+
Instrumentation.EndContext();
8393
#line 9 "TagHelpersInHelper.cshtml"
8494

8595
#line default
@@ -106,6 +116,7 @@ public override async Task ExecuteAsync()
106116
__tagHelpersExecutionContext.Add(__MyTagHelper);
107117
__tagHelpersExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelpersExecutionContext).Result;
108118
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateStartTag());
119+
Instrumentation.BeginContext(338, 9, false);
109120
Write(
110121
#line 10 "TagHelpersInHelper.cshtml"
111122
MyHelper(
@@ -133,9 +144,12 @@ public override async Task ExecuteAsync()
133144
#line hidden
134145
);
135146

147+
Instrumentation.EndContext();
136148
WriteLiteral(__tagHelpersExecutionContext.Output.GenerateEndTag());
137149
__tagHelpersExecutionContext = __tagHelperScopeManager.End();
150+
Instrumentation.BeginContext(410, 2, true);
138151
WriteLiteral("\r\n");
152+
Instrumentation.EndContext();
139153
}
140154
#pragma warning restore 1998
141155
}

test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/TagHelpersInSection.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
#pragma checksum "TagHelpersInSection.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "bfe8d61279682f87dc473aa71134e86af554f55e"
12
namespace TestOutput
23
{
34
using System;
45
using System.Threading.Tasks;
56

67
public class TagHelpersInSection
78
{
9+
private System.IO.TextWriter __tagHelperStringValueBuffer = null;
10+
private TagHelperExecutionContext __tagHelpersExecutionContext = null;
11+
private TagHelperRunner __tagHelperRunner = new TagHelperRunner();
12+
private TagHelperScopeManager __tagHelperScopeManager = new TagHelperScopeManager();
13+
private MyTagHelper __MyTagHelper = null;
14+
private NestedTagHelper __NestedTagHelper = null;
815
#line hidden
916
public TagHelpersInSection()
1017
{
@@ -20,9 +27,13 @@ public override async Task ExecuteAsync()
2027
#line default
2128
#line hidden
2229

30+
Instrumentation.BeginContext(34, 4, true);
2331
WriteLiteral("\r\n\r\n");
32+
Instrumentation.EndContext();
2433
DefineSection("MySection", new Template((__razor_template_writer) => {
34+
Instrumentation.BeginContext(58, 21, true);
2535
WriteLiteralTo(__razor_template_writer, "\r\n <div>\r\n ");
36+
Instrumentation.EndContext();
2637
__tagHelpersExecutionContext = __tagHelperScopeManager.Begin("mytaghelper");
2738
__MyTagHelper = CreateTagHelper<MyTagHelper>();
2839
__tagHelpersExecutionContext.Add(__MyTagHelper);
@@ -53,7 +64,9 @@ public override async Task ExecuteAsync()
5364
__tagHelpersExecutionContext.AddHtmlAttribute("unboundproperty", __tagHelperStringValueBuffer.ToString());
5465
__tagHelpersExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelpersExecutionContext).Result;
5566
WriteLiteralTo(__razor_template_writer, __tagHelpersExecutionContext.Output.GenerateStartTag());
67+
Instrumentation.BeginContext(182, 52, true);
5668
WriteLiteralTo(__razor_template_writer, "\r\n In None ContentBehavior.\r\n ");
69+
Instrumentation.EndContext();
5770
__tagHelpersExecutionContext = __tagHelperScopeManager.Begin("nestedtaghelper");
5871
__NestedTagHelper = CreateTagHelper<NestedTagHelper>();
5972
__tagHelpersExecutionContext.Add(__NestedTagHelper);
@@ -73,10 +86,14 @@ public override async Task ExecuteAsync()
7386
WriteLiteralTo(__razor_template_writer, __tagHelpersExecutionContext.Output.GenerateContent());
7487
WriteLiteralTo(__razor_template_writer, __tagHelpersExecutionContext.Output.GenerateEndTag());
7588
__tagHelpersExecutionContext = __tagHelperScopeManager.End();
89+
Instrumentation.BeginContext(300, 10, true);
7690
WriteLiteralTo(__razor_template_writer, "\r\n ");
91+
Instrumentation.EndContext();
7792
WriteLiteralTo(__razor_template_writer, __tagHelpersExecutionContext.Output.GenerateEndTag());
7893
__tagHelpersExecutionContext = __tagHelperScopeManager.End();
94+
Instrumentation.BeginContext(324, 14, true);
7995
WriteLiteralTo(__razor_template_writer, "\r\n </div>\r\n");
96+
Instrumentation.EndContext();
8097
}
8198
));
8299
}

0 commit comments

Comments
 (0)