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

Issue 543303002: chromeos: power: Refactor RendererFreezer and add tests (Closed)

Created:
6 years, 3 months ago by Chirantan Ekbote
Modified:
6 years, 3 months ago
Reviewers:
Daniel Erat
CC:
chromium-reviews, davemoore+watch_chromium.org, dominicc (has gone to gerrit), hashimoto+watch_chromium.org, nkostylev+watch_chromium.org, oshima+watch_chromium.org, Sameer Nanda, stevenjb+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

chromeos: power: Refactor RendererFreezer and add tests Refactor the RendererFreezer class so that untestable code is moved into a delegate and add unit tests. Modify FakePowerManagerClient so that it provides more information for tests. Also use a CancelableClosure for the asynchronous suspend readiness callback in case we get a SuspendDone before we've had a chance to run OnReadyForSuspend(). BUG=364339, 414396 Signed-off-by: Chirantan Ekbote <chirantan@chromium.org>; Committed: https://crrev.com/b651946eea95c8af526e4df1e06809385f8cb822 Cr-Commit-Position: refs/heads/master@{#295111}

Patch Set 1 #

Patch Set 2 : add more tests #

Total comments: 10

Patch Set 3 : Address comments. #

Total comments: 6

Patch Set 4 : address comments and add new test #

Patch Set 5 : fix merge conflicts #

Total comments: 1

Patch Set 6 : include base/macros.h #

Unified diffs Side-by-side diffs Delta from patch set Stats (+436 lines, -65 lines) Patch
M chrome/browser/chromeos/chrome_browser_main_chromeos.cc View 1 2 3 4 2 chunks +4 lines, -1 line 0 comments Download
A chrome/browser/chromeos/power/freezer_cgroup_process_manager.h View 1 2 3 4 5 1 chunk +36 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/power/freezer_cgroup_process_manager.cc View 1 2 3 1 chunk +73 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/power/renderer_freezer.h View 1 2 3 4 5 3 chunks +26 lines, -7 lines 0 comments Download
M chrome/browser/chromeos/power/renderer_freezer.cc View 1 2 3 1 chunk +35 lines, -55 lines 0 comments Download
A chrome/browser/chromeos/power/renderer_freezer_unittest.cc View 1 2 3 1 chunk +237 lines, -0 lines 0 comments Download
M chrome/chrome_browser_chromeos.gypi View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chromeos/dbus/fake_power_manager_client.h View 1 2 3 4 5 3 chunks +8 lines, -0 lines 0 comments Download
M chromeos/dbus/fake_power_manager_client.cc View 1 2 4 chunks +14 lines, -2 lines 0 comments Download

Messages

Total messages: 11 (2 generated)
Chirantan Ekbote
Please take a look.
6 years, 3 months ago (2014-09-06 01:23:36 UTC) #2
Daniel Erat
thanks for adding tests https://codereview.chromium.org/543303002/diff/20001/chrome/browser/chromeos/power/renderer_freezer.cc File chrome/browser/chromeos/power/renderer_freezer.cc (right): https://codereview.chromium.org/543303002/diff/20001/chrome/browser/chromeos/power/renderer_freezer.cc#newcode30 chrome/browser/chromeos/power/renderer_freezer.cc:30: delegate_.reset(); nit: you shouldn't need ...
6 years, 3 months ago (2014-09-06 02:01:25 UTC) #3
Chirantan Ekbote
ptal https://codereview.chromium.org/543303002/diff/40001/chrome/browser/chromeos/power/freezer_cgroup_process_manager.h File chrome/browser/chromeos/power/freezer_cgroup_process_manager.h (right): https://codereview.chromium.org/543303002/diff/40001/chrome/browser/chromeos/power/freezer_cgroup_process_manager.h#newcode14 chrome/browser/chromeos/power/freezer_cgroup_process_manager.h:14: class FreezerCgroupProcessManager : public RendererFreezer::Delegate { I named ...
6 years, 3 months ago (2014-09-12 22:35:09 UTC) #4
Daniel Erat
lgtm with some comments https://codereview.chromium.org/543303002/diff/40001/chrome/browser/chromeos/power/freezer_cgroup_process_manager.cc File chrome/browser/chromeos/power/freezer_cgroup_process_manager.cc (right): https://codereview.chromium.org/543303002/diff/40001/chrome/browser/chromeos/power/freezer_cgroup_process_manager.cc#newcode35 chrome/browser/chromeos/power/freezer_cgroup_process_manager.cc:35: return base::WriteFile(state_path_, kFreezeCommand, strlen(kFreezeCommand)) == ...
6 years, 3 months ago (2014-09-12 22:53:22 UTC) #5
Chirantan Ekbote
Please take another look. I moved some things around and added another test. https://codereview.chromium.org/543303002/diff/40001/chrome/browser/chromeos/power/renderer_freezer_unittest.cc File ...
6 years, 3 months ago (2014-09-16 02:51:41 UTC) #6
Daniel Erat
lgtm https://codereview.chromium.org/543303002/diff/80001/chrome/browser/chromeos/power/freezer_cgroup_process_manager.h File chrome/browser/chromeos/power/freezer_cgroup_process_manager.h (right): https://codereview.chromium.org/543303002/diff/80001/chrome/browser/chromeos/power/freezer_cgroup_process_manager.h#newcode8 chrome/browser/chromeos/power/freezer_cgroup_process_manager.h:8: #include "base/files/file_path.h" nit: add base/macros.h for DISALLOW_COPY_AND_ASSIGN
6 years, 3 months ago (2014-09-16 04:42:47 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/543303002/100001
6 years, 3 months ago (2014-09-16 17:38:32 UTC) #9
commit-bot: I haz the power
Committed patchset #6 (id:100001) as 04d9f351abf634522a39e0953a53e53b27f8c56c
6 years, 3 months ago (2014-09-16 18:41:30 UTC) #10
commit-bot: I haz the power
6 years, 3 months ago (2014-09-16 18:42:55 UTC) #11
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/b651946eea95c8af526e4df1e06809385f8cb822
Cr-Commit-Position: refs/heads/master@{#295111}

Powered by Google App Engine
This is Rietveld 408576698