Skip to content

Commit

Permalink
Add getHardwarePlatformInfo to thunk.js for Hangouts
Browse files Browse the repository at this point in the history
 Bug: 860311

Change-Id: Ifd314660829cc7434621e22b8d709e6ef233973f
Reviewed-on: https://chromium-review.googlesource.com/1193849
Commit-Queue: Guido Urdaneta <[email protected]>
Reviewed-by: Henrik Grunell <[email protected]>
Cr-Original-Commit-Position: refs/heads/master@{#588275}(cherry picked from commit 1165f3f)
Reviewed-on: https://chromium-review.googlesource.com/1209382
Reviewed-by: Guido Urdaneta <[email protected]>
Cr-Commit-Position: refs/branch-heads/3538@{#84}
Cr-Branched-From: 79f7c91-refs/heads/master@{#587811}
  • Loading branch information
Guido Urdaneta committed Sep 6, 2018
1 parent bb5d6c7 commit b97ba7c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion chrome/browser/resources/hangout_services/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Google Hangouts",
// Note: Always update the version number when this file is updated. Chrome
// triggers extension preferences update on the version increase.
"version": "1.3.8",
"version": "1.3.9",
"manifest_version": 2,
"externally_connectable": {
"matches": [
Expand All @@ -21,6 +21,7 @@
"incognito": "split",
"permissions": [
"desktopCapture",
"enterprise.hardwarePlatform",
"processes",
"system.cpu",
"webrtcAudioPrivate",
Expand Down
4 changes: 4 additions & 0 deletions chrome/browser/resources/hangout_services/thunk.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ chrome.runtime.onMessageExternal.addListener(function(
chrome.webrtcAudioPrivate.setAudioExperiments(
requestInfo, origin, experiments, doSendResponse);
return true;
} else if (method == 'getHardwarePlatformInfo') {
chrome.enterprise.hardwarePlatform.getHardwarePlatformInfo(
doSendResponse);
return true;
}

throw new Error('Unknown method: ' + method);
Expand Down
16 changes: 16 additions & 0 deletions chrome/test/data/extensions/hangout_services_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ function getAssociatedSink(sourceId, callback) {
callback);
}

// Will call |callback(hardwarePlatformInfo)| on completion.
function getHardwarePlatformInfo(callback) {
sendMessage({'method': 'getHardwarePlatformInfo'}, callback);
}

// Will call |callback()| on completion. If the extension you send to
// is not loaded, the extension system will still call |callback()|
// but will set lastError.
Expand Down Expand Up @@ -374,6 +379,17 @@ function testStoreLog(callback) {
});
}

function testGetHardwarePlatformInfo(callback) {
getHardwarePlatformInfo(function(hardwarePlatformInfo) {
if (hardwarePlatformInfo.hasOwnProperty('manufacturer') &&
hardwarePlatformInfo.hasOwnProperty('model')) {
callback('');
} else {
callback('Missing information in hardwarePlatformInfo');
}
});
}

function testTimeout(callback) {
// Never call the callback. Used for manually testing that the
// timeout logic of the test framework is correct.
Expand Down

0 comments on commit b97ba7c

Please sign in to comment.