blob: ebec24fd773d8b045dfdafaa6e2f4a80a9897608 [file] [log] [blame]
// Copyright (c) 2012 The Chromium OS 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 <gtest/gtest.h>
#include "permission_broker/allow_usb_device_rule.h"
namespace permission_broker {
class AllowUsbDeviceRuleTest : public testing::Test {
public:
AllowUsbDeviceRuleTest() {}
virtual ~AllowUsbDeviceRuleTest() {}
protected:
AllowUsbDeviceRule rule_;
private:
DISALLOW_COPY_AND_ASSIGN(AllowUsbDeviceRuleTest);
};
TEST_F(AllowUsbDeviceRuleTest, IgnoreNonUsbDevice) {
ASSERT_EQ(Rule::IGNORE, rule_.Process("/dev/loop0",
Rule::ANY_INTERFACE));
}
TEST_F(AllowUsbDeviceRuleTest, AllowUsbDevice) {
ASSERT_EQ(Rule::ALLOW, rule_.Process("/dev/bus/usb/001/001",
Rule::ANY_INTERFACE));
}
} // namespace permission_broker