summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/google_now/background_test_util.js
blob: f68356c9932c3fe1c9d6baa2e5722915412365da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Mocks for globals needed for loading background.js.

var wrapper = {instrumentChromeApiFunction: emptyMock};

function buildAuthenticationManager() {
  return {
    addListener: emptyMock
  };
}

var instrumentApiFunction = emptyMock;
var buildTaskManager = emptyMock;
var buildAttemptManager = emptyMock;
var buildCardSet = emptyMock;

var instrumented = {};
mockChromeEvent(instrumented, 'location.onLocationUpdate');
mockChromeEvent(instrumented, 'notifications.onButtonClicked');
mockChromeEvent(instrumented, 'notifications.onClicked');
mockChromeEvent(instrumented, 'notifications.onClosed');
mockChromeEvent(instrumented, 'notifications.onPermissionLevelChanged');
mockChromeEvent(instrumented, 'notifications.onShowSettings');
mockChromeEvent(
    instrumented, 'preferencesPrivate.googleGeolocationAccessEnabled.onChange');
mockChromeEvent(instrumented, 'pushMessaging.onMessage');
mockChromeEvent(instrumented, 'runtime.onInstalled');
mockChromeEvent(instrumented, 'runtime.onStartup');