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

Side by Side Diff: chrome/browser/resources/settings/settings_private_proto.js

Issue 1447103002: MD Settings: FakeSettingsPrivate for tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: assertNotReached Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 /* Copyright 2015 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. */
4
5 /** @fileoverview Provides an interface for that can be overridden in tests. */
6
7 assertNotReached('Proto file should not be executed.');
Dan Beam 2015/11/20 02:16:06 what is a proto file?
michaelpg 2015/11/21 23:03:50 renamed to interface.
Dan Beam 2015/11/23 18:56:09 you should probably keep the file name and class n
8
9 /** @interface */
10 function SettingsPrivate() {}
11
12 SettingsPrivate.prototype = {
13
Dan Beam 2015/11/20 02:18:20 nit: remove \n
michaelpg 2015/11/21 23:03:50 Done.
14 /**
15 * Sets a settings value.
16 * @param {string} name The name of the pref.
17 * @param {*} value The new value of the pref.
18 * @param {string} pageId The user metrics identifier or null.
19 * @param {function(boolean):void} callback The callback for whether the pref
20 * was set or not.
21 * @see https://developer.chrome.com/extensions/settingsPrivate#method-setPref
22 */
23 setPref: assertNotReached,
michaelpg 2015/11/20 00:51:06 this is weird, why is closure OK with a named func
Dan Beam 2015/11/20 01:58:17 because we have magic to identify "assertNotReache
michaelpg 2015/11/21 23:03:50 Acknowledged.
24
25 /**
26 * Gets an array of all the prefs.
27 * @param {function(!Array<!chrome.settingsPrivate.PrefObject>):void} callback
28 * @see https://developer.chrome.com/extensions/settingsPrivate#method-getAllP refs
29 */
30 getAllPrefs: assertNotReached,
31
32 /**
33 * Gets the value of a specific pref.
34 * @param {string} name
35 * @param {function(!chrome.settingsPrivate.PrefObject):void} callback
36 * @see https://developer.chrome.com/extensions/settingsPrivate#method-getPref
37 */
38 getPref: assertNotReached,
39
40 /**
41 * Gets the page zoom factor as an integer percentage.
42 * @param {function(number):void} callback
43 * @see https://developer.chrome.com/extensions/settingsPrivate#method-getDefa ultZoomPercent
44 */
45 getDefaultZoomPercent: assertNotReached,
46
47 /**
48 * Sets the page zoom factor from a zoom percentage.
49 * @param {number} percent
50 * @param {function(boolean):void=} callback
51 * @see https://developer.chrome.com/extensions/settingsPrivate#method-setDefa ultZoomPercent
52 */
53 setDefaultZoomPercent: assertNotReached,
54
55 /**
56 * <p>Fired when a set of prefs has changed.</p><p>|prefs| The prefs that
57 * changed.</p>
58 * @type {!ChromeEvent}
59 * @see https://developer.chrome.com/extensions/settingsPrivate#event-onPrefsC hanged
60 */
61 onPrefsChanged: new ChromeEvent(),
62 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/prefs/prefs_types.js ('k') | chrome/test/data/webui/settings/cr_settings_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698