forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This CL adds a unit testing harness for ui/gl tests. In order to ensure that the bots do not break once they start running these unit tests, gl_unittests currently it does not run any tests. Once the bots successfully run gl_unittests, we can safely add tests using the trybots to make sure the added tests actually work. R=danakj@chromium.org, sievers@chromium.org BUG=482067 Review URL: https://codereview.chromium.org/1121353002 Cr-Commit-Position: refs/heads/master@{#328407}
- Loading branch information
dyen
authored and
Commit bot
committed
May 5, 2015
1 parent
d2561bb
commit 781489a
Showing
7 changed files
with
165 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Copyright 2015 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. | ||
|
||
{ | ||
'variables': { | ||
'chromium_code': 1, | ||
}, | ||
'targets': [ | ||
{ | ||
'target_name': 'gl_unittests', | ||
'type': '<(gtest_target_type)', | ||
'sources': [ | ||
'test/run_all_unittests.cc', | ||
], | ||
'dependencies': [ | ||
'<(DEPTH)/base/base.gyp:base', | ||
'<(DEPTH)/base/base.gyp:test_support_base', | ||
'<(DEPTH)/testing/gtest.gyp:gtest', | ||
], | ||
'conditions': [ | ||
['OS == "android"', { | ||
'dependencies': [ | ||
'<(DEPTH)/testing/android/native_test.gyp:native_test_native_code', | ||
], | ||
}], | ||
], | ||
} | ||
], | ||
'conditions': [ | ||
['OS == "android"', { | ||
'targets': [ | ||
{ | ||
'target_name': 'gl_unittests_apk', | ||
'type': 'none', | ||
'dependencies': [ | ||
'gl_unittests', | ||
], | ||
'variables': { | ||
'test_suite_name': 'gl_unittests', | ||
}, | ||
'includes': [ '../../build/apk_test.gypi' ], | ||
}, | ||
], | ||
}], | ||
['test_isolation_mode != "noop"', { | ||
'targets': [ | ||
{ | ||
'target_name': 'gl_unittests_run', | ||
'type': 'none', | ||
'dependencies': [ | ||
'gl_unittests', | ||
], | ||
'includes': [ | ||
'../../build/isolate.gypi', | ||
], | ||
'sources': [ | ||
'gl_unittests.isolate', | ||
], | ||
'conditions': [ | ||
['use_x11 == 1', { | ||
'dependencies': [ | ||
'<(DEPTH)/tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck', | ||
], | ||
}], | ||
], | ||
}, | ||
], | ||
}], | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2015 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. | ||
{ | ||
'conditions': [ | ||
['OS=="android" or OS=="linux" or OS=="mac" or OS=="win"', { | ||
'variables': { | ||
'command': [ | ||
'<(PRODUCT_DIR)/gl_unittests<(EXECUTABLE_SUFFIX)', | ||
], | ||
'files': [ | ||
'<(PRODUCT_DIR)/gl_unittests<(EXECUTABLE_SUFFIX)', | ||
], | ||
}, | ||
}], | ||
], | ||
'includes': [ | ||
'../../base/base.isolate', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright 2015 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 "base/bind.h" | ||
#include "base/test/launcher/unit_test_launcher.h" | ||
#include "base/test/test_suite.h" | ||
|
||
#if defined(OS_MACOSX) && !defined(OS_IOS) | ||
#include "base/test/mock_chrome_application_mac.h" | ||
#endif | ||
|
||
namespace { | ||
|
||
class GlTestSuite : public base::TestSuite { | ||
public: | ||
GlTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) { | ||
} | ||
|
||
protected: | ||
void Initialize() override { | ||
base::TestSuite::Initialize(); | ||
|
||
#if defined(OS_MACOSX) && !defined(OS_IOS) | ||
mock_cr_app::RegisterMockCrApp(); | ||
#endif | ||
} | ||
|
||
void Shutdown() override { | ||
base::TestSuite::Shutdown(); | ||
} | ||
|
||
private: | ||
DISALLOW_COPY_AND_ASSIGN(GlTestSuite); | ||
}; | ||
|
||
} // namespace | ||
|
||
int main(int argc, char** argv) { | ||
GlTestSuite test_suite(argc, argv); | ||
|
||
return base::LaunchUnitTests( | ||
argc, | ||
argv, | ||
base::Bind(&GlTestSuite::Run, base::Unretained(&test_suite))); | ||
} |