3 Copyright (c) 2014 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file.
7 <link rel="import" href="/tvcm/guid.html">
8 <link rel="import" href="/tvcm/unittest/constants.html">
12 tvcm.exportTo('tvcm.unittest', function() {
13 var TestTypes = tvcm.unittest.TestTypes;
15 function TestCase(suite, testType, name, test, options) {
16 this.guid_ = tvcm.GUID.allocate();
18 this.testType_ = testType;
21 this.options_ = options;
26 TestCase.parseFullyQualifiedName = function(fqn) {
27 var i = fqn.lastIndexOf('.');
29 throw new Error('FullyQualifiedNames must have a period in them');
31 suiteName: fqn.substr(0, i),
32 testCaseName: fqn.substr(i + 1)
36 TestCase.prototype = {
37 __proto__: Object.prototype,
48 return this.testType_;
55 get fullyQualifiedName() {
56 return this.suite_.name + '.' + this.name_;
63 run: function(htmlHook) {
67 // TODO(nduca): The routing of this is a bit awkward. Probably better
68 // to install a global function.
69 addHTMLOutput: function(element) {
70 tvcm.unittest.addHTMLOutputForCurrentTest(element);
74 function PerfTestCase(suite, name, test, options) {
75 TestCase.call(this, suite, TestTypes.PERFTEST, name, test, options);
78 PerfTestCase.prototype = {
79 __proto__: TestCase.prototype
84 PerfTestCase: PerfTestCase