Merge "Remove unused embed/... files and BUILD rules"
This commit is contained in:
commit
98e0ed4543
@ -55,7 +55,6 @@ filegroup(
|
||||
exclude = [
|
||||
"bower_components/**",
|
||||
"**/*_test.html",
|
||||
"embed/test.html",
|
||||
"test/**",
|
||||
"samples/**",
|
||||
],
|
||||
@ -166,33 +165,6 @@ DIRECTORIES = [
|
||||
],
|
||||
) for directory in DIRECTORIES]
|
||||
|
||||
# Embed bundle
|
||||
polygerrit_bundle(
|
||||
name = "polygerrit_embed_ui",
|
||||
srcs = glob(
|
||||
[
|
||||
"**/*.html",
|
||||
"**/*.js",
|
||||
],
|
||||
exclude = [
|
||||
"bower_components/**",
|
||||
"test/**",
|
||||
"**/*_test.html",
|
||||
],
|
||||
),
|
||||
outs = ["polygerrit_embed_ui.zip"],
|
||||
app = "embed/embed.html",
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "embed_test_files",
|
||||
srcs = glob(
|
||||
[
|
||||
"embed/**/*_test.html",
|
||||
],
|
||||
),
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "template_test_srcs",
|
||||
srcs = [
|
||||
@ -200,21 +172,3 @@ filegroup(
|
||||
"template_test_srcs/template_test.js",
|
||||
],
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "embed_test",
|
||||
size = "small",
|
||||
srcs = ["embed_test.sh"],
|
||||
data = [
|
||||
"embed/test.html",
|
||||
"test/common-test-setup.html",
|
||||
":embed_test_files",
|
||||
":pg_code.zip",
|
||||
":test_components.zip",
|
||||
],
|
||||
# Should not run sandboxed.
|
||||
tags = [
|
||||
"local",
|
||||
"manual",
|
||||
],
|
||||
)
|
||||
|
@ -1,27 +0,0 @@
|
||||
<!--
|
||||
@license
|
||||
Copyright (C) 2017 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<script>
|
||||
window.Gerrit = window.Gerrit || {};
|
||||
</script>
|
||||
<link rel="import" href="/bower_components/polymer/polymer.html">
|
||||
<link rel="import" href="../elements/change/gr-change-view/gr-change-view.html">
|
||||
<link rel="import" href="../elements/core/gr-search-bar/gr-search-bar.html">
|
||||
<link rel="import" href="../elements/diff/gr-diff-view/gr-diff-view.html">
|
||||
<link rel="import" href="../elements/change-list/gr-change-list-view/gr-change-list-view.html">
|
||||
<link rel="import" href="../elements/change-list/gr-dashboard-view/gr-dashboard-view.html">
|
||||
<link rel="import" href="../elements/change-list/gr-embed-dashboard/gr-embed-dashboard.html">
|
||||
<link rel="import" href="../styles/themes/app-theme.html">
|
@ -1,98 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (C) 2017 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
||||
<title>embed_test</title>
|
||||
|
||||
<script src="/bower_components/webcomponentsjs/custom-elements-es5-adapter.js"></script>
|
||||
|
||||
<script src="/bower_components/webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="/bower_components/web-component-tester/browser.js"></script>
|
||||
<link rel="import" href="embed.html"/>
|
||||
|
||||
<script>void(0);</script>
|
||||
|
||||
<test-fixture id="change-view">
|
||||
<template>
|
||||
<gr-change-view></gr-change-view>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="diff-view">
|
||||
<template>
|
||||
<gr-diff-view></gr-diff-view>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="dashboard-view">
|
||||
<template>
|
||||
<gr-dashboard-view></gr-dashboard-view>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="change-list-view">
|
||||
<template>
|
||||
<gr-change-list-view></gr-change-list-view>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="change-list">
|
||||
<template>
|
||||
<gr-change-list></gr-change-list>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="search-bar">
|
||||
<template>
|
||||
<gr-search-bar></gr-search-bar>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
suite('embed test', () => {
|
||||
test('gr-change-view is embedded', () => {
|
||||
const element = fixture('change-view');
|
||||
assert.equal(element.tagName.toLowerCase(), 'gr-change-view');
|
||||
});
|
||||
|
||||
test('diff-view is embedded', () => {
|
||||
const element = fixture('diff-view');
|
||||
assert.equal(element.tagName.toLowerCase(), 'gr-diff-view');
|
||||
});
|
||||
|
||||
test('dashboard-view is embedded', () => {
|
||||
const element = fixture('dashboard-view');
|
||||
assert.equal(element.tagName.toLowerCase(), 'gr-dashboard-view');
|
||||
});
|
||||
|
||||
test('change-list-view is embedded', () => {
|
||||
const element = fixture('change-list-view');
|
||||
assert.equal(element.tagName.toLowerCase(), 'gr-change-list-view');
|
||||
});
|
||||
|
||||
test('change-list is embedded', () => {
|
||||
const element = fixture('change-list');
|
||||
assert.equal(element.tagName.toLowerCase(), 'gr-change-list');
|
||||
});
|
||||
|
||||
test('search-bar is embedded', () => {
|
||||
const element = fixture('search-bar');
|
||||
assert.equal(element.tagName.toLowerCase(), 'gr-search-bar');
|
||||
});
|
||||
});
|
||||
</script>
|
@ -1,26 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (C) 2017 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Embed Test Runner</title>
|
||||
<meta charset="utf-8">
|
||||
<script src="/bower_components/webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="/bower_components/web-component-tester/browser.js"></script>
|
||||
<script>
|
||||
WCT.loadSuites(['../embed/embed_test.html']);
|
||||
</script>
|
@ -1,69 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
t=$(mktemp -d || mktemp -d -t wct-XXXXXXXXXX)
|
||||
components=$TEST_SRCDIR/gerrit/polygerrit-ui/app/test_components.zip
|
||||
code=$TEST_SRCDIR/gerrit/polygerrit-ui/app/pg_code.zip
|
||||
|
||||
echo $t
|
||||
unzip -qd $t $components
|
||||
unzip -qd $t $code
|
||||
# Purge test/ directory contents coming from pg_code.zip.
|
||||
rm -rf $t/test
|
||||
mkdir -p $t/test
|
||||
cp $TEST_SRCDIR/gerrit/polygerrit-ui/app/embed/test.html $t/test/
|
||||
|
||||
if [ "${WCT_HEADLESS_MODE:-0}" != "0" ]; then
|
||||
CHROME_OPTIONS=[\'start-maximized\',\'headless\',\'disable-gpu\',\'no-sandbox\']
|
||||
FIREFOX_OPTIONS=[\'-headless\']
|
||||
else
|
||||
CHROME_OPTIONS=[\'start-maximized\']
|
||||
FIREFOX_OPTIONS=[\'\']
|
||||
fi
|
||||
|
||||
# For some reason wct tries to install selenium into its node_modules
|
||||
# directory on first run. If you've installed into /usr/local and
|
||||
# aren't running wct as root, you're screwed. Turning this option off
|
||||
# through skipSeleniumInstall seems to still work, so there's that.
|
||||
|
||||
# Sauce tests are disabled by default in order to run local tests
|
||||
# only. Run it with (saucelabs.com account required; free for open
|
||||
# source): WCT_ARGS='--plugin sauce' ./polygerrit-ui/app/embed_test.sh
|
||||
|
||||
cat <<EOF > $t/wct.conf.js
|
||||
module.exports = {
|
||||
'suites': ['test'],
|
||||
'webserver': {
|
||||
'pathMappings': [
|
||||
{'/components/bower_components': 'bower_components'}
|
||||
]
|
||||
},
|
||||
'plugins': {
|
||||
'local': {
|
||||
'skipSeleniumInstall': true,
|
||||
'browserOptions': {
|
||||
'chrome': ${CHROME_OPTIONS},
|
||||
'firefox': ${FIREFOX_OPTIONS}
|
||||
}
|
||||
},
|
||||
'sauce': {
|
||||
'disabled': true,
|
||||
'browsers': [
|
||||
'OS X 10.12/chrome',
|
||||
'Windows 10/chrome',
|
||||
'Linux/firefox',
|
||||
'OS X 10.12/safari',
|
||||
'Windows 10/microsoftedge'
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
EOF
|
||||
|
||||
export PATH="$(dirname $NPM):$PATH"
|
||||
|
||||
cd $t
|
||||
test -n "${WCT}"
|
||||
|
||||
${WCT} ${WCT_ARGS}
|
@ -48,5 +48,4 @@ ${bazel_bin} test \
|
||||
--test_env="DISPLAY=${DISPLAY}" \
|
||||
--test_env="WCT_HEADLESS_MODE=${WCT_HEADLESS_MODE}" \
|
||||
"$@" \
|
||||
//polygerrit-ui/app:embed_test \
|
||||
//polygerrit-ui/app:wct_test
|
||||
|
Loading…
Reference in New Issue
Block a user