summaryrefslogtreecommitdiffstats
path: root/tests/auto/core/origins/tst_origins.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix compiler warnings in testsMoss Heim2024-03-191-3/+2
| | | | | | | Unused parameters Change-Id: I1c300daefc5461aa692f8624d6af7c5f9ce80464 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Do more WE processing before returning to the Qt event-loopAllan Sandfeld Jensen2023-09-291-4/+4
| | | | | | | | | Fix a race-condition in our tests that the change exposed Pick-to: 6.6 Task-number: QTBUG-116478 Change-Id: Id21c6b0bc9934fdcb69bd85350f5f263a9b96914 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Improve LocalContentCanAccess(File/Remote)Urls settingsSzabolcs David2023-06-011-6/+95
| | | | | | | | | | | Do not prevent access to files when users navigate by user gesture, reload, or navigate the main frame back and forward in history. Task-number: QTBUG-113413 Task-number: QTBUG-113485 Change-Id: I942362f7048618dac7a067c8713285deb4ca06f5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Attempt to fix flaky fetchAPI testAllan Sandfeld Jensen2023-02-131-1/+1
| | | | | | Change-Id: I0aa38930767c2caf37c9f641f5f65967e6c73356 Reviewed-by: Yigit Akcay <yigit.akcay@qt.io> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Custom URL Schemes usable with HTML5 Fetch ApiYigit Akcay2023-02-091-1/+128
| | | | | | | | | | | | | This change adds the QWebEngineUrlScheme::FetchApiAllowed flag and test cases to test its effect. When FetchApiAllowed flag is set a custom url scheme can be used by the HTML5 fetch api. Fixes: QTBUG-88830 Change-Id: I953dd0504bf508fd8082fae5db08b7b9fc47ea1f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Rewrite mixedSchemes testMichal Klocek2022-12-091-86/+142
| | | | | | | | | | | | | | Follow the same 'test' pattern we have in other tests. Note that this and previous change make test suite for tst_origin execute faster form ~170s to ~60s for desktop linux and from ~320s to ~140s for qemu. Task-number: QTBUG-105342 Pick-to: 6.4 Change-Id: I5cd0aa0a76fcc2d005cee398a88ba4099f9881c3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Reduce slowness and flakiness of tst_originMichal Klocek2022-12-091-10/+18
| | | | | | | | | | | | | | | | | | | | | | This test runs very slow and it is flaky. Make it run faster by: * instead of doing timeout checks for "cannotLoad", introduce <image> element add use 'onload' and 'onerror' handlers before doing actual <iframe> load, this dropps a need for hardcoded delay/deadline for ifrme being loaded. * do not evaluate JavaScript in try wait loop , use JavaScript messages instead. Note that using <img> or <script> element to perform the test (which have onload and onerros handler unlike iframe) ie. loading cross origin scripts or images instead of iframes is a dead-end as it has different results and "canLoadButNotAccess" can not be tested as origin BAR can load a script from origin FOO, but it still works in BAR‘s context. Task-number: QTBUG-105342 Pick-to: 6.4 Change-Id: I180aea801cedb0f97b96cb90a54b793d0a7c1a7f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Adaptations for 106-basedAllan Sandfeld Jensen2022-11-281-2/+2
| | | | | | Change-Id: I2fe91c06ce91dfaace7825a0589b56ee375479b6 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Port from container::count() and length() to size() - V4Marc Mutz2022-10-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); a.k.a qt-port-to-std-compatible-api V4 with config Scope: 'Container'. Change-Id: I3e6fef8eca212da0c4f0b464545ba96183b4476f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-221-27/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I869ffda1080e283f231eb0dc4477b260f2054d99 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Test local, secure and file redirectsAllan Sandfeld Jensen2022-06-181-23/+169
| | | | | | | Pick-to: 6.4 Task-number: QTBUG-99207 Change-Id: I28a3d06f97c0973ccc0f23bd90de58e89b19eb7a Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Add test for blocking of remote contentAllan Sandfeld Jensen2022-02-141-0/+33
| | | | | | | Pick-to: 6.3 6.2 Task-number: QTBUG-50686 Change-Id: Ie176bece1a44a6df608646e91171d02ceeea7e8f Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Improve local scheme access rulesAllan Sandfeld Jensen2022-01-281-63/+289
| | | | | | | Pick-to: 6.3 6.2 Task-number: QTBUG-96849 Change-Id: Ieb24da12a61e5e37b29ccf2d1a11b7bd863b842e Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Add testing of redirect by interceptorAllan Sandfeld Jensen2022-01-191-19/+74
| | | | | | | | | Looks the same in the interceptor, but different in the jobs. Extra combinations not yet tested. Change-Id: Ib9c34029e5dd293d30380ce42495905fbcab12b7 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Cleanup code and clang build warningsKirill Burtsev2022-01-021-2/+3
| | | | | | | | | Fix build noise as reported by clang for issues like api deprecation, unused variables, sign/unsigned mismatch and other non critical issues. Pick-to: 6.2 Change-Id: I4fba25406eea8170e3283c42e908ae86bd512e3a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Adaptations for Chromium 94Allan Sandfeld Jensen2021-12-021-4/+4
| | | | | Change-Id: I9fb8998a3a7762b0aea70993ca231f0bbf4f7761 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Extend schemes access test with LocalContentCanAccess* flagsKirill Burtsev2021-10-271-69/+124
| | | | | | | Pick-to: 6.2 5.15 Change-Id: I2124d6eef038157e0664a96dfa333b14064541c1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Block CORS from local URLs when remote access is not enabledAllan Sandfeld Jensen2021-10-121-1/+1
| | | | | | | Pick-to: 6.2 5.15 Task-number: QTBUG-96849 Change-Id: I0e0a1530b8b31341c632a1fd00abd339b5152da0 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Remove local-access-allowed from qrcAllan Sandfeld Jensen2021-08-121-2/+2
| | | | | | Pick-to: 6.2 Change-Id: I120f4e4e167d621efb6c13f5d16cc13134540352 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Remove QRC->file special caseAllan Sandfeld Jensen2021-07-011-3/+5
| | | | | | | | It was marked as to be removed for Qt6 Pick-to: 6.2 Change-Id: I059c450aa6e5cad6d48ecdd2667abff21217d7e0 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Stop using Widgets in WebEngineCore testsAllan Sandfeld Jensen2021-06-161-0/+958
With QWebEnginePage in Core we can now make the core tests core-only. Add the same times moves tests from widgets that only uses core classes. Pick-to: 6.2 Change-Id: I67a25b534912d9a0891e16b0419f0db9bf434e92 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>