|
|
DescriptionRefactor reloading tests in ImageResourceTest.cpp
This CL merges the things after LoFi/Placeholder reloading is started
into testThatReloadIsStartedThenServeReload().
BUG=667641
Review-Url: https://codereview.chromium.org/2650543003
Cr-Commit-Position: refs/heads/master@{#451369}
Committed: https://chromium.googlesource.com/chromium/src/+/d4601dd9252054edfcd8bb4e4c2a93f11c307d85
Patch Set 1 #Patch Set 2 : Rebase #Patch Set 3 : rebase #Patch Set 4 : Rebase #Patch Set 5 : Rebase #Patch Set 6 : Rebase #Patch Set 7 : Rebase #Patch Set 8 : Rebase #
Total comments: 5
Patch Set 9 : Rename to testThatReloadIsStartedThenServeReload #
Total comments: 18
Patch Set 10 : Rebase and Reflect comments #Patch Set 11 : Rebase #Messages
Total messages: 54 (43 generated)
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Refactor reloading tests in ImageResourceTest.cpp BUG= ========== to ========== Refactor reloading tests in ImageResourceTest.cpp BUG= ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...) win_clang on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_clang/builds/...)
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_comp...) android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...) chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Description was changed from ========== Refactor reloading tests in ImageResourceTest.cpp BUG= ========== to ========== Refactor reloading tests in ImageResourceTest.cpp BUG=667641 ==========
hiroshige@chromium.org changed reviewers: + japhet@chromium.org, sclittle@chromium.org, yhirano@chromium.org
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Refactor reloading tests in ImageResourceTest.cpp BUG=667641 ========== to ========== Refactor reloading tests in ImageResourceTest.cpp This CL merges the things after LoFi/Placeholder reloading is started into testThatReloadIsStartedAndDoReload(). BUG=667641 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_clang_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clan...) android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_comp...) android_cronet on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_cron...) linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...) cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linu...) chromeos_amd64-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-...) chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_...) chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...) linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_tsan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-xco...) mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...) win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
PTAL. (Bots are currently red just because Patch failures and I expect will be green after https://codereview.chromium.org/2648073002/ is landed) https://codereview.chromium.org/2650543003/diff/140001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp (left): https://codereview.chromium.org/2650543003/diff/140001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:1216: EXPECT_EQ(1, imageResource->getContent()->getImage()->height()); This test used kJpegImage as the reloaded image (and thus its width is 1 here), while this CL changes this to kJpegImage2 (as testThatReloadIsStartedAndDoReload() always uses kJpegImage2). This is OK because this part of the test confirms that correct image is (re)loaded, not depending on what image it is. https://codereview.chromium.org/2650543003/diff/140001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:1288: EXPECT_EQ(1, imageResource->getContent()->getImage()->height()); ditto. https://codereview.chromium.org/2650543003/diff/140001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:1531: EXPECT_EQ(1, imageResource->getContent()->getImage()->height()); ditto.
LGTM with a naming nit https://codereview.chromium.org/2650543003/diff/140001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp (right): https://codereview.chromium.org/2650543003/diff/140001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:169: void testThatReloadIsStartedAndDoReload( This name is a little weird: I would expect that "Do"ing the reload would include "Starting" it. Maybe testThatReloadIsStartedThenServeReload()?
lgtm
https://codereview.chromium.org/2650543003/diff/140001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp (right): https://codereview.chromium.org/2650543003/diff/140001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:169: void testThatReloadIsStartedAndDoReload( On 2017/02/07 22:05:56, Nate Chapin wrote: > This name is a little weird: I would expect that "Do"ing the reload would > include "Starting" it. Maybe testThatReloadIsStartedThenServeReload()? Nice suggestion! Done.
https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp (left): https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:510: EXPECT_EQ(3, observer->imageChangedCount()); Shouldn't this assertion be preserved? https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp (right): https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:175: WebCachePolicy policyForReload = WebCachePolicy::BypassingCache) { Why do you use a default parameter? It makes things unclear in general, and in this particular case, I'm not sure which should be the default value as you are using the value only for one assertion. https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:178: const int imageWidth = 50; constexpr https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:179: const int imageHeight = 50; ditto https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:190: static_cast<int>(imageResource->resourceRequest().getCachePolicy())); I think we can remove these static_casts. https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:196: EXPECT_EQ(alreadyNotifiedFinish, observer->imageNotifyFinishedCalled()); You leave EXPECT_EQ(t/f, observer->imageNotifyFinishedCalled()) in some tests and you don't in other tests. Can we be consistent on the point? I prefer putting the assertion out of this function, stop passing the boolean to this function and initializing alreadyNotifiedFinish here, but it's not a strong opinion. https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:198: observer->imageWidthOnImageNotifyFinished(); ASSERT_NE(imageWidth, imageWidthOnImageNotifyFinished); https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:216: EXPECT_EQ(imageWidthOnImageNotifyFinished, Putting a comment explaining that you are using |imageWidth| to check if notifiyFinished is called again would be helpful. https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:639: testThatReloadIsStartedThenServeReload(testURL, imageResource, Can you tell me why you use testThatReload... function here?
Patchset #10 (id:180001) has been deleted
https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp (left): https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:510: EXPECT_EQ(3, observer->imageChangedCount()); On 2017/02/08 02:11:07, yhirano wrote: > Shouldn't this assertion be preserved? Done. https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp (right): https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:175: WebCachePolicy policyForReload = WebCachePolicy::BypassingCache) { On 2017/02/08 02:11:07, yhirano wrote: > Why do you use a default parameter? It makes things unclear in general, and in > this particular case, I'm not sure which should be the default value as you are > using the value only for one assertion. Done. https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:178: const int imageWidth = 50; On 2017/02/08 02:11:07, yhirano wrote: > constexpr Done. https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:179: const int imageHeight = 50; On 2017/02/08 02:11:07, yhirano wrote: > ditto Done. https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:190: static_cast<int>(imageResource->resourceRequest().getCachePolicy())); On 2017/02/08 02:11:07, yhirano wrote: > I think we can remove these static_casts. Done. https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:196: EXPECT_EQ(alreadyNotifiedFinish, observer->imageNotifyFinishedCalled()); On 2017/02/08 02:11:07, yhirano wrote: > You leave EXPECT_EQ(t/f, observer->imageNotifyFinishedCalled()) in some tests > and you don't in other tests. Can we be consistent on the point? I prefer > putting the assertion out of this function, stop passing the boolean to this > function and initializing alreadyNotifiedFinish here, but it's not a strong > opinion. Done. > putting the assertion out of this function Agree, because I noticed we anyway have to put (and actually put) assertion of EXPECT_TRUE(observer->imageNotifyFinishedCalled()) in the caller, BEFORE reloading is started. https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:198: observer->imageWidthOnImageNotifyFinished(); On 2017/02/08 02:11:08, yhirano wrote: > ASSERT_NE(imageWidth, imageWidthOnImageNotifyFinished); Done. https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:216: EXPECT_EQ(imageWidthOnImageNotifyFinished, On 2017/02/08 02:11:08, yhirano wrote: > Putting a comment explaining that you are using |imageWidth| to check if > notifiyFinished is called again would be helpful. I removed this then-clause, because the mock observer has ASSERT_EQ() to check imageNotifyFinished() is not called twice, and thus checking imageWidthOnImageNotifyFinished() again is not helpful. Also added a comment. https://codereview.chromium.org/2650543003/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:639: testThatReloadIsStartedThenServeReload(testURL, imageResource, On 2017/02/08 02:11:08, yhirano wrote: > Can you tell me why you use testThatReload... function here? Some tests test that reloading is started and serve the reloaded response, while some tests (like this) only test that reloading is started and just cancel the reloading. I think there are no fundamental differences between the two types of tests, and thus I make these tests to always server the reloaded response, and thus used testThat...() function here.
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Refactor reloading tests in ImageResourceTest.cpp This CL merges the things after LoFi/Placeholder reloading is started into testThatReloadIsStartedAndDoReload(). BUG=667641 ========== to ========== Refactor reloading tests in ImageResourceTest.cpp This CL merges the things after LoFi/Placeholder reloading is started into testThatReloadIsStartedThenServeReload(). BUG=667641 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm
The CQ bit was checked by hiroshige@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from japhet@chromium.org, sclittle@chromium.org Link to the patchset: https://codereview.chromium.org/2650543003/#ps200001 (title: "Rebase and Reflect comments")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-xco...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by hiroshige@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from japhet@chromium.org, yhirano@chromium.org, sclittle@chromium.org Link to the patchset: https://codereview.chromium.org/2650543003/#ps220001 (title: "Rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 220001, "attempt_start_ts": 1487357810738300, "parent_rev": "f5df21df7ccb7b4dcbff0c6d7f8c5f1e1276af31", "commit_rev": "d4601dd9252054edfcd8bb4e4c2a93f11c307d85"}
Message was sent while issue was closed.
Description was changed from ========== Refactor reloading tests in ImageResourceTest.cpp This CL merges the things after LoFi/Placeholder reloading is started into testThatReloadIsStartedThenServeReload(). BUG=667641 ========== to ========== Refactor reloading tests in ImageResourceTest.cpp This CL merges the things after LoFi/Placeholder reloading is started into testThatReloadIsStartedThenServeReload(). BUG=667641 Review-Url: https://codereview.chromium.org/2650543003 Cr-Commit-Position: refs/heads/master@{#451369} Committed: https://chromium.googlesource.com/chromium/src/+/d4601dd9252054edfcd8bb4e4c2a... ==========
Message was sent while issue was closed.
Committed patchset #11 (id:220001) as https://chromium.googlesource.com/chromium/src/+/d4601dd9252054edfcd8bb4e4c2a... |