Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: test/codegen_test.dart

Issue 993213003: Support browser caching using hashes in serverMode (fixes #93, fixes #92) (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/codegen/expect/server_mode/html_input.txt ('k') | test/dependency_graph_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen_test.dart
diff --git a/test/codegen_test.dart b/test/codegen_test.dart
index ee89b60e199b035c0164a258f9e4f7b34f8f6c5d..4d0b75dc130f8e5b85bcb6df81f19b61237147c2 100644
--- a/test/codegen_test.dart
+++ b/test/codegen_test.dart
@@ -56,9 +56,10 @@ main(arguments) {
.map((f) => f.path)
.where((p) => p.endsWith('.dart') && filePattern.hasMatch(p));
- compile(String entryPoint, String sdkPath, [bool checkSdk = false]) {
+ compile(String entryPoint, String sdkPath,
+ {bool checkSdk: false, bool serverMode: false}) {
var options = new CompilerOptions(
- outputDir: actualDir,
+ outputDir: serverMode ? path.join(actualDir, 'server_mode') : actualDir,
useColors: false,
outputDart: dartGen,
formatOutput: dartGen,
@@ -67,7 +68,8 @@ main(arguments) {
cheapTestFormat: checkSdk,
checkSdk: checkSdk,
entryPointFile: entryPoint,
- dartSdkPath: sdkPath);
+ dartSdkPath: sdkPath,
+ serverMode: serverMode);
return new Compiler(options).run();
}
var realSdk = getSdkDir(arguments).path;
@@ -127,7 +129,7 @@ main(arguments) {
var testSdk = dartGen
? path.join(testDir, '..', 'tool', 'input_sdk')
: path.join(testDir, 'generated_sdk');
- var result = compile('dart:core', testSdk, true);
+ var result = compile('dart:core', testSdk, checkSdk: true);
var outputDir = new Directory(path.join(actualDir, 'core'));
var outFile = dartGen
? new File(path.join(actualDir, 'core/core'))
@@ -153,6 +155,23 @@ main(arguments) {
expect(outFile.existsSync(), success,
reason: '${outFile.path} was created iff compilation succeeds');
});
+
+ test('devc jscodegen html_input.html server mode', () {
+ var filePath = path.join(inputDir, 'html_input.html');
+ compilerMessages.writeln('// Messages from compiling html_input.html');
+
+ var result = compile(filePath, realSdk, serverMode: true);
+ var success = !result.failure;
+
+ // Write compiler messages to disk.
+ new File(path.join(actualDir, 'server_mode', 'html_input.txt'))
+ .writeAsStringSync(compilerMessages.toString());
+
+ var outFile =
+ new File(path.join(actualDir, 'server_mode', 'html_input.html'));
+ expect(outFile.existsSync(), success,
+ reason: '${outFile.path} was created iff compilation succeeds');
+ });
}
}
« no previous file with comments | « test/codegen/expect/server_mode/html_input.txt ('k') | test/dependency_graph_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698