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

Unified Diff: remoting/webapp/crd/js/l10n_unittest.js

Issue 1017613002: Migrate Remoting Webapp Unittests to use QUnit 2.0 syntax. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Async test migration 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
Index: remoting/webapp/crd/js/l10n_unittest.js
diff --git a/remoting/webapp/crd/js/l10n_unittest.js b/remoting/webapp/crd/js/l10n_unittest.js
index 78ea48e2c36bf39d82d0e9daa700165e34daa97a..71ef1a20b5d485360b88d08e743545af677a0312 100644
--- a/remoting/webapp/crd/js/l10n_unittest.js
+++ b/remoting/webapp/crd/js/l10n_unittest.js
@@ -6,21 +6,21 @@
'use strict';
-module('l10n', {
- setup: function() {
+QUnit.module('l10n', {
+ beforeEach: function() {
sinon.stub(chrome.i18n, 'getMessage');
},
- teardown: function() {
+ afterEach: function() {
$testStub(chrome.i18n.getMessage).restore();
}
});
-test('getTranslationOrError(tag) should return tag on error', function() {
+QUnit.test('getTranslationOrError(tag) should return tag on error', function() {
var translation = l10n.getTranslationOrError('non_existent_tag');
- equal(translation, 'non_existent_tag');
+ QUnit.equal(translation, 'non_existent_tag');
});
-test('localizeElementFromTag() should replace innerText by default',
+QUnit.test('localizeElementFromTag() should replace innerText by default',
function() {
var element = document.createElement('div');
$testStub(chrome.i18n.getMessage).withArgs('tag')
@@ -28,10 +28,10 @@ test('localizeElementFromTag() should replace innerText by default',
l10n.localizeElementFromTag(element, 'tag');
- equal(element.innerHTML, '<b>Hello World</b>');
+ QUnit.equal(element.innerHTML, '<b>Hello World</b>');
});
-test('localizeElementFromTag() should replace innerHTML if flag is set',
+QUnit.test('localizeElementFromTag() should replace innerHTML if flag is set',
function() {
var element = document.createElement('div');
$testStub(chrome.i18n.getMessage).withArgs('tag')
@@ -39,10 +39,10 @@ test('localizeElementFromTag() should replace innerHTML if flag is set',
l10n.localizeElementFromTag(element, 'tag', null, true);
- equal(element.innerHTML, '<b>Hello World</b>');
+ QUnit.equal(element.innerHTML, '<b>Hello World</b>');
});
-test(
+QUnit.test(
'localizeElement() should replace innerText using the "i18n-content" ' +
'attribute as the tag',
function() {
@@ -53,10 +53,10 @@ test(
l10n.localizeElement(element);
- equal(element.innerHTML, '&lt;b&gt;Hello World&lt;/b&gt;');
+ QUnit.equal(element.innerHTML, '&lt;b&gt;Hello World&lt;/b&gt;');
});
-test(
+QUnit.test(
'localize() should replace element title using the "i18n-title" ' +
'attribute as the tag',
function() {
@@ -69,10 +69,10 @@ test(
l10n.localize();
var target = document.querySelector('.target');
- equal(target.title, 'localized title');
+ QUnit.equal(target.title, 'localized title');
});
-test('localize() should support string substitutions', function() {
+QUnit.test('localize() should support string substitutions', function() {
var fixture = document.getElementById('qunit-fixture');
fixture.innerHTML =
'<div class="target" ' +
@@ -87,10 +87,10 @@ test('localize() should support string substitutions', function() {
l10n.localize();
var target = document.querySelector('.target');
- equal(target.innerText, 'localized');
+ QUnit.equal(target.innerText, 'localized');
});
-test('localize() should support tag substitutions', function() {
+QUnit.test('localize() should support tag substitutions', function() {
var fixture = document.getElementById('qunit-fixture');
fixture.innerHTML =
'<div class="target" i18n-content="tag"' +
@@ -105,7 +105,7 @@ test('localize() should support tag substitutions', function() {
l10n.localize();
var target = document.querySelector('.target');
- equal(target.innerText, 'localized');
+ QUnit.equal(target.innerText, 'localized');
});
})();

Powered by Google App Engine
This is Rietveld 408576698