#include "chrome/browser/extensions/api/messaging/native_messaging_host_manifest.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/json/string_escape.h"
#include "base/strings/strcat.h"
#include "base/strings/stringprintf.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "chrome/common/chrome_features.h"
#include "extensions/common/url_pattern_set.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace extensions {
const char kTestHostName[] = …;
#if BUILDFLAG(IS_WIN)
const char kTestHostPath[] = "C:\\ProgramFiles\\host.exe";
#else
const char kTestHostPath[] = …;
#endif
const char kTestOrigin[] = …;
class NativeMessagingHostManifestTest : public ::testing::Test { … };
TEST_F(NativeMessagingHostManifestTest, HostNameValidation) { … }
TEST_F(NativeMessagingHostManifestTest, LoadValid) { … }
TEST_F(NativeMessagingHostManifestTest,
LoadValid_SupportsNativeInitiatedConnections) { … }
TEST_F(NativeMessagingHostManifestTest,
LoadValid_SupportsNativeInitiatedConnectionsWithFeatureDisabled) { … }
TEST_F(NativeMessagingHostManifestTest,
LoadValid_DoesNotSupportNativeInitiatedConnections) { … }
TEST_F(NativeMessagingHostManifestTest,
LoadValid_DoesNotSpecifySupportNativeInitiatedConnections) { … }
TEST_F(NativeMessagingHostManifestTest,
LoadInvalidSupportsNativeInitiatedConnections) { … }
TEST_F(NativeMessagingHostManifestTest, InvalidName) { … }
TEST_F(NativeMessagingHostManifestTest, MatchAllOrigin) { … }
}