|
|
Chromium Code Reviews|
Created:
3 years, 9 months ago by Marc Treib Modified:
3 years, 9 months ago CC:
chromium-reviews Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
Description[Doodle] Add conversion to dictionary for DoodleImage and DoodleConfig
This also adds a bunch of tests for the conversion to/from dict.
BUG=690467
Review-Url: https://codereview.chromium.org/2748653002
Cr-Commit-Position: refs/heads/master@{#456655}
Committed: https://chromium.googlesource.com/chromium/src/+/42b88efd1fc0721c8c97e1d5dfb89e4b9ce58fa9
Patch Set 1 #Patch Set 2 : includes #
Total comments: 7
Patch Set 3 : review #Patch Set 4 : check invalid URL parsing result #
Dependent Patchsets: Messages
Total messages: 33 (21 generated)
The CQ bit was checked by treib@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 ========== [Doodle] Add conversion to dictionary for DoodleImage and DoodleConfig This also adds a bunch of tests for the parsing. BUG=690467 ========== to ========== [Doodle] Add conversion to dictionary for DoodleImage and DoodleConfig This also adds a bunch of tests for the conversion to/from dict. BUG=690467 ==========
treib@chromium.org changed reviewers: + fhorschig@chromium.org
PTAL!
The CQ bit was checked by treib@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...
lgtm!
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
treib@chromium.org changed reviewers: + sfiera@chromium.org
+sfiera for committer's stamp, once again. PTAL!
https://codereview.chromium.org/2748653002/diff/20001/components/doodle/doodl... File components/doodle/doodle_types_unittest.cc (right): https://codereview.chromium.org/2748653002/diff/20001/components/doodle/doodl... components/doodle/doodle_types_unittest.cc:247: DoodleConfig::FromDictionary(*config.ToDictionary(), base::nullopt); Should fields be preserved when round-tripping with a different base URL? Should they be changed? https://codereview.chromium.org/2748653002/diff/20001/components/doodle/doodl... components/doodle/doodle_types_unittest.cc:253: Invalid URLs? I think you have a DCHECK when making a dict with one (e.g. {"url": "bad::scheme"}), and I'm not sure we should be DCHECKing validity of data from a backend.
https://codereview.chromium.org/2748653002/diff/20001/components/doodle/doodl... File components/doodle/doodle_types_unittest.cc (right): https://codereview.chromium.org/2748653002/diff/20001/components/doodle/doodl... components/doodle/doodle_types_unittest.cc:247: DoodleConfig::FromDictionary(*config.ToDictionary(), base::nullopt); On 2017/03/13 13:07:53, sfiera wrote: > Should fields be preserved when round-tripping with a different base URL? Should > they be changed? They should be preserved - the resolving only applies to relative URLs, and we always persist absolute ones. (The whole resolving is a bit of a hack...) I've added a different base_url here and added a comment to explain. https://codereview.chromium.org/2748653002/diff/20001/components/doodle/doodl... components/doodle/doodle_types_unittest.cc:253: On 2017/03/13 13:07:53, sfiera wrote: > Invalid URLs? I think you have a DCHECK when making a dict with one (e.g. > {"url": "bad::scheme"}), and I'm not sure we should be DCHECKing validity of > data from a backend. Which DCHECK do you mean? I've added tests with invalid URLs; the code already handled that.
The CQ bit was checked by treib@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...
LGTM https://codereview.chromium.org/2748653002/diff/20001/components/doodle/doodl... File components/doodle/doodle_types_unittest.cc (right): https://codereview.chromium.org/2748653002/diff/20001/components/doodle/doodl... components/doodle/doodle_types_unittest.cc:253: On 2017/03/13 13:29:12, Marc Treib wrote: > On 2017/03/13 13:07:53, sfiera wrote: > > Invalid URLs? I think you have a DCHECK when making a dict with one (e.g. > > {"url": "bad::scheme"}), and I'm not sure we should be DCHECKing validity of > > data from a backend. > > Which DCHECK do you mean? > I've added tests with invalid URLs; the code already handled that. GURL::spec() DCHECKs on non-empty, invalid URLs. You call spec() in ToDictionary(). "url" was the wrong example; I think "search_url" would trigger it.
Patchset #4 (id:60001) has been deleted
The CQ bit was checked by treib@chromium.org to run a CQ dry run
https://codereview.chromium.org/2748653002/diff/20001/components/doodle/doodl... File components/doodle/doodle_types_unittest.cc (right): https://codereview.chromium.org/2748653002/diff/20001/components/doodle/doodl... components/doodle/doodle_types_unittest.cc:253: On 2017/03/13 13:46:15, sfiera wrote: > On 2017/03/13 13:29:12, Marc Treib wrote: > > On 2017/03/13 13:07:53, sfiera wrote: > > > Invalid URLs? I think you have a DCHECK when making a dict with one (e.g. > > > {"url": "bad::scheme"}), and I'm not sure we should be DCHECKing validity of > > > data from a backend. > > > > Which DCHECK do you mean? > > I've added tests with invalid URLs; the code already handled that. > > GURL::spec() DCHECKs on non-empty, invalid URLs. You call spec() in > ToDictionary(). "url" was the wrong example; I think "search_url" would trigger > it. Ah - the GURL construction handles that, it returns empty GURLs for invalid input. I've added EXPECTs here to make sure the GURLs are empty. Good catch though, thanks!
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2748653002/diff/20001/components/doodle/doodl... File components/doodle/doodle_types_unittest.cc (right): https://codereview.chromium.org/2748653002/diff/20001/components/doodle/doodl... components/doodle/doodle_types_unittest.cc:253: On 2017/03/13 14:04:32, Marc Treib wrote: > On 2017/03/13 13:46:15, sfiera wrote: > > On 2017/03/13 13:29:12, Marc Treib wrote: > > > On 2017/03/13 13:07:53, sfiera wrote: > > > > Invalid URLs? I think you have a DCHECK when making a dict with one (e.g. > > > > {"url": "bad::scheme"}), and I'm not sure we should be DCHECKing validity > of > > > > data from a backend. > > > > > > Which DCHECK do you mean? > > > I've added tests with invalid URLs; the code already handled that. > > > > GURL::spec() DCHECKs on non-empty, invalid URLs. You call spec() in > > ToDictionary(). "url" was the wrong example; I think "search_url" would > trigger > > it. > > Ah - the GURL construction handles that, it returns empty GURLs for invalid > input. I've added EXPECTs here to make sure the GURLs are empty. > Good catch though, thanks! Hmm. I wonder how I knew about this, then—I could swear I've hit that DCHECK before, but now I don't even know how to create an invalid GURL like that :)
The CQ bit was unchecked by treib@chromium.org
The CQ bit was checked by treib@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from fhorschig@chromium.org, sfiera@chromium.org Link to the patchset: https://codereview.chromium.org/2748653002/#ps80001 (title: "check invalid URL parsing result")
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: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by treib@chromium.org
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": 80001, "attempt_start_ts": 1489478494603710,
"parent_rev": "689574a569c0f9a83b918c011f05bebde3267183", "commit_rev":
"42b88efd1fc0721c8c97e1d5dfb89e4b9ce58fa9"}
Message was sent while issue was closed.
Description was changed from ========== [Doodle] Add conversion to dictionary for DoodleImage and DoodleConfig This also adds a bunch of tests for the conversion to/from dict. BUG=690467 ========== to ========== [Doodle] Add conversion to dictionary for DoodleImage and DoodleConfig This also adds a bunch of tests for the conversion to/from dict. BUG=690467 Review-Url: https://codereview.chromium.org/2748653002 Cr-Commit-Position: refs/heads/master@{#456655} Committed: https://chromium.googlesource.com/chromium/src/+/42b88efd1fc0721c8c97e1d5dfb8... ==========
Message was sent while issue was closed.
Committed patchset #4 (id:80001) as https://chromium.googlesource.com/chromium/src/+/42b88efd1fc0721c8c97e1d5dfb8... |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
