New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 614864 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Feature



Sign in to add a comment

Make OfflinePageModel an interface so that is can be mocked for testing

Project Member Reported by dougarnett@chromium.org, May 25 2016

Issue description

Seems to be a common thought within the team and I am blocked writing some unit tests so will take a stab at this.
 

Comment 1 by romax@chromium.org, May 25 2016

610824 seems to be related.
In splitting apart interface and implementation, I see some apparently undefined methods - offline_page_model.h claimed to override but don't find code for them in .cc:
  
  void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids,
                              const DeletePageCallback& callback) override;

  void GetAllPages(const MultipleOfflinePageItemCallback& callback) override;

so I am not sure what is going on with these (taking them out of the interface CL for now).
Also don't see impl for this variant: 

  void DeletePageByOfflineId(int64_t offline_id,
                             const DeletePageCallback& callback);

Comment 4 by romax@chromium.org, May 25 2016

sorry for the confusion but those two methods are from OfflinePageStorageManager::Client, which is implemented by OfflinePageModel
Project Member

Comment 5 by bugdroid1@chromium.org, May 31 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/76f2e5a378d9d1ab6daf69cb77723adf6d2c40eb

commit 76f2e5a378d9d1ab6daf69cb77723adf6d2c40eb
Author: dougarnett <dougarnett@chromium.org>
Date: Tue May 31 19:07:09 2016

Splits the OfflinePageModel into and interface and and implementation class.

Tried to make mostly straightforward split for this iteration. Some static members and methods
were interesting deal with and we might consider better location/resolution to follow-up on.

BUG= 614864 , 610824 

Review-Url: https://codereview.chromium.org/2011763005
Cr-Commit-Position: refs/heads/master@{#396885}

[modify] https://crrev.com/76f2e5a378d9d1ab6daf69cb77723adf6d2c40eb/chrome/browser/android/offline_pages/offline_page_model_factory.cc
[modify] https://crrev.com/76f2e5a378d9d1ab6daf69cb77723adf6d2c40eb/chrome/browser/android/offline_pages/test_offline_page_model_builder.cc
[modify] https://crrev.com/76f2e5a378d9d1ab6daf69cb77723adf6d2c40eb/components/components_tests.gyp
[modify] https://crrev.com/76f2e5a378d9d1ab6daf69cb77723adf6d2c40eb/components/offline_pages.gypi
[modify] https://crrev.com/76f2e5a378d9d1ab6daf69cb77723adf6d2c40eb/components/offline_pages/BUILD.gn
[modify] https://crrev.com/76f2e5a378d9d1ab6daf69cb77723adf6d2c40eb/components/offline_pages/offline_page_model.cc
[modify] https://crrev.com/76f2e5a378d9d1ab6daf69cb77723adf6d2c40eb/components/offline_pages/offline_page_model.h
[add] https://crrev.com/76f2e5a378d9d1ab6daf69cb77723adf6d2c40eb/components/offline_pages/offline_page_model_impl.cc
[add] https://crrev.com/76f2e5a378d9d1ab6daf69cb77723adf6d2c40eb/components/offline_pages/offline_page_model_impl.h
[rename] https://crrev.com/76f2e5a378d9d1ab6daf69cb77723adf6d2c40eb/components/offline_pages/offline_page_model_impl_unittest.cc

Status: Fixed (was: Untriaged)
This task of making an interface to allow mocking is now done. 

More work identified in original bug: https://bugs.chromium.org/p/chromium/issues/detail?id=610824

And some specific cleanups identified in: https://bugs.chromium.org/p/chromium/issues/detail?id=615165

Sign in to add a comment