This simple piece of code:
#include "content/public/browser/web_contents_observer.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
class MockWebContentsObserver : public content::WebContentsObserver {
public:
explicit MockWebContentsObserver(content::WebContents* web_contents)
: WebContentsObserver(web_contents) {}
MOCK_METHOD1(DidGetUserInteraction, void(const blink::WebInputEvent::Type type));
};
TEST(FooTest, Bar) {
MockWebContentsObserver observer(nullptr);
EXPECT_CALL(observer, DidGetUserInteraction(testing::_));
}
gives following compilation errors on Windows:
error C2220: warning treated as error - no 'object' file generated
warning C4373: 'MockWebContentsObserver::DidGetUserInteraction': virtual function overrides 'content::WebContentsObserver::DidGetUserInteraction', previous versions of the compiler did not override when parameters only differed by const/volatile qualifiers
note: see declaration of 'content::WebContentsObserver::DidGetUserInteraction'
ninja: build stopped: subcommand failed.
Comment 1 by tmonius...@opera.com
, Apr 5 2016