user_note_model_test_utils.cc 928 B

12345678910111213141516171819202122232425262728
  1. // Copyright 2022 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "components/user_notes/model/user_note_model_test_utils.h"
  5. #include "base/time/time.h"
  6. namespace user_notes {
  7. std::unique_ptr<UserNoteMetadata> GetTestUserNoteMetadata() {
  8. base::Time now = base::Time::Now();
  9. int note_version = 1;
  10. return std::make_unique<UserNoteMetadata>(now, now, note_version);
  11. }
  12. std::unique_ptr<UserNoteBody> GetTestUserNoteBody() {
  13. return std::make_unique<UserNoteBody>(u"test note");
  14. }
  15. std::unique_ptr<UserNoteTarget> GetTestUserNotePageTarget(
  16. const std::string& url) {
  17. return std::make_unique<UserNoteTarget>(UserNoteTarget::TargetType::kPage,
  18. /*original_text=*/u"", GURL(url),
  19. /*selector=*/"");
  20. }
  21. } // namespace user_notes