blob: 11317b5a93aa0f8c46112fa4753bc38ba81a2ace [file] [log] [blame]
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/test/metrics/histogram_tester.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "testing/gtest/include/gtest/gtest.h"
using ShowFeedbackPageTest = BrowserWithTestWindowTest;
// TODO(crbug.com/1128855): Fix the test for Lacros build.
// TODO(crbug.com/1167223): Fix the test for WebUIFeedback.
TEST_F(ShowFeedbackPageTest, DISABLED_UserFeedbackDisallowed) {
base::HistogramTester histogram_tester;
std::string unused;
chrome::ShowFeedbackPage(browser(), chrome::kFeedbackSourceBrowserCommand,
unused, unused, unused, unused, base::Value::Dict());
histogram_tester.ExpectTotalCount("Feedback.RequestSource", 1);
browser()->profile()->GetPrefs()->SetBoolean(prefs::kUserFeedbackAllowed,
false);
chrome::ShowFeedbackPage(browser(), chrome::kFeedbackSourceBrowserCommand,
unused, unused, unused, unused, base::Value::Dict());
histogram_tester.ExpectTotalCount("Feedback.RequestSource", 1);
}