Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / chrome / browser / resources / chromeos / chromevox / testing / test_msgs.js
blobd76c16dc1c49deff24b2765082ca7f4f4203ed32
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6 /**
7 * @fileoverview Testing stub for messages.
8 */
10 goog.provide('cvox.TestMsgs');
12 goog.require('cvox.Msgs');
13 goog.require('cvox.TestMessages');
16 /**
17 * @constructor
18 * @extends {cvox.Msgs}
20 cvox.TestMsgs = function() {
21 cvox.Msgs.call(this);
23 goog.inherits(cvox.TestMsgs, cvox.Msgs);
26 /**
27 * @override
29 cvox.TestMsgs.prototype.getLocale = function() {
30 return 'testing';
34 /**
35 * @override
37 cvox.TestMsgs.prototype.getMsg = function(messageId, opt_subs) {
38 if (!messageId) {
39 throw Error('Message id required');
41 var message = cvox.TestMessages[('chromevox_' + messageId).toUpperCase()];
42 if (message == undefined) {
43 throw Error('missing-msg: ' + messageId);
46 var messageString = message.message;
47 if (opt_subs) {
48 // Unshift a null to make opt_subs and message.placeholders line up.
49 for (var i = 0; i < opt_subs.length; i++) {
50 messageString = messageString.replace('$' + (i + 1), opt_subs[i]);
53 return messageString;