Skip to content

Commit

Permalink
feedback: Add skeleton and build plumbing for help content provider
Browse files Browse the repository at this point in the history
- Adds backend class skeleton
- Adds simple unit test
- Add build plumbing for tests and code

Bug: b:185624798
Test: ash_webui_unittests --gtest_filter="HelpContentProviderTest.*"
Change-Id: Iea87eb1588eea5d3734bc1fdf7d332723d3cf72f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3451178
Reviewed-by: Jimmy Gong <jimmyxgong@chromium.org>
Commit-Queue: Xiangdong Kong <xiangdongkong@google.com>
Cr-Commit-Position: refs/heads/main@{#969789}
  • Loading branch information
xiangdong kong authored and Chromium LUCI CQ committed Feb 11, 2022
1 parent 013178d commit 75498d6
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 0 deletions.
1 change: 1 addition & 0 deletions ash/webui/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ test("ash_webui_unittests") {
"//ash/webui/eche_app_ui:unit_tests",
"//ash/webui/file_manager:unit_tests",
"//ash/webui/help_app_ui:unit_tests",
"//ash/webui/os_feedback_ui/backend:unit_tests",
"//ash/webui/projector_app:unit_tests",
"//ash/webui/scanning:unit_tests",
"//ash/webui/shimless_rma/backend:unit_tests",
Expand Down
1 change: 1 addition & 0 deletions ash/webui/os_feedback_ui/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ static_library("os_feedback_ui") {
]

deps = [
"//ash/webui/os_feedback_ui/backend",
"//ash/webui/resources:os_feedback_resources",
"//ash/webui/resources:os_feedback_untrusted_resources",
"//content/public/browser",
Expand Down
28 changes: 28 additions & 0 deletions ash/webui/os_feedback_ui/backend/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2022 The Chromium Authors.All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/chromeos/ui_mode.gni")

assert(is_chromeos_ash, "Non-ChromeOS builds cannot depend on //ash")

static_library("backend") {
sources = [
"help_content_provider.cc",
"help_content_provider.h",
]

deps = []
}

source_set("unit_tests") {
testonly = true

sources = [ "help_content_provider_unittest.cc" ]

deps = [
":backend",
"//base/test:test_support",
"//testing/gtest",
]
}
14 changes: 14 additions & 0 deletions ash/webui/os_feedback_ui/backend/help_content_provider.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/webui/os_feedback_ui/backend/help_content_provider.h"

namespace ash {
namespace feedback {

HelpContentProvider::HelpContentProvider() = default;
HelpContentProvider::~HelpContentProvider() = default;

} // namespace feedback
} // namespace ash
22 changes: 22 additions & 0 deletions ash/webui/os_feedback_ui/backend/help_content_provider.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ASH_WEBUI_OS_FEEDBACK_UI_BACKEND_HELP_CONTENT_PROVIDER_H_
#define ASH_WEBUI_OS_FEEDBACK_UI_BACKEND_HELP_CONTENT_PROVIDER_H_

namespace ash {
namespace feedback {

class HelpContentProvider {
public:
HelpContentProvider();
HelpContentProvider(const HelpContentProvider&) = delete;
HelpContentProvider& operator=(const HelpContentProvider&) = delete;
~HelpContentProvider();
};

} // namespace feedback
} // namespace ash

#endif // ASH_WEBUI_OS_FEEDBACK_UI_BACKEND_HELP_CONTENT_PROVIDER_H_
24 changes: 24 additions & 0 deletions ash/webui/os_feedback_ui/backend/help_content_provider_unittest.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/webui/os_feedback_ui/backend/help_content_provider.h"

#include "testing/gtest/include/gtest/gtest.h"

namespace ash {
namespace feedback {

class HelpContentProviderTest : public testing::Test {
public:
HelpContentProviderTest() = default;
~HelpContentProviderTest() override = default;
};

TEST_F(HelpContentProviderTest, DummyTest) {
HelpContentProvider provider;
EXPECT_TRUE(true);
}

} // namespace feedback
} // namespace ash

0 comments on commit 75498d6

Please sign in to comment.