Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
9fde788
feat: upgrade delete|copy|paste|cut|selectAll actions
temper357 May 10, 2022
867b2dc
feat: upgrade flutter version for integration tests
temper357 May 10, 2022
94f9fd1
feat: upgrade extend/move selection actions
temper357 May 10, 2022
edeab24
Merge remote-tracking branch 'origin/main' into feat/text-control-flu…
andycall Jul 3, 2022
80d81a2
fix: upgrade to android embedder.
andycall Jul 3, 2022
96c811e
fix: fix linter
andycall Jul 3, 2022
c468061
chore: fix dom specs.
andycall Jul 4, 2022
a836601
fix: add integration test linux support.
andycall Jul 4, 2022
c96c290
feat: add integration linux platform support.
andycall Jul 5, 2022
07e8153
feat: add flutter 3.0.4 support.
andycall Jul 6, 2022
0e17c83
feat: upgrade test ci.
andycall Jul 6, 2022
88f9f46
fix: fix example build.
andycall Jul 6, 2022
252f291
chore: upgrade integration tests.
andycall Jul 6, 2022
8763aec
feat: add more test steps in integration
andycall Jul 6, 2022
1f09006
fix: fix flutter unit test.
andycall Jul 6, 2022
c1a7c7e
fix: fix run bridge unit test
andycall Jul 6, 2022
02e80fe
add linux test
suyulin Jul 26, 2022
fef9451
Revert "add linux test"
suyulin Jul 26, 2022
8a9fdf2
Merge remote-tracking branch 'origin/main' into feat/flutter-3
andycall Jul 26, 2022
fe19901
feat: migrate dart code from kraken to webf
andycall Jul 27, 2022
e03cf0c
fix test
suyulin Jul 27, 2022
8fc9add
fix test
suyulin Jul 27, 2022
d663103
fix test
suyulin Jul 27, 2022
a0a5a58
chore: migrate kraken to webf
andycall Jul 27, 2022
d2c6d22
Committing clang-format changes
Jul 27, 2022
baa38a7
Merge remote-tracking branch 'origin/feat/fix-test' into feat/flutter-3
andycall Jul 27, 2022
133a72b
Merge branch 'feat/flutter-3' of github.com:openwebf/webf into feat/f…
andycall Jul 27, 2022
c4ccb9c
fix test
suyulin Jul 27, 2022
9b85048
rename macos kraken -> webf
suyulin Jul 27, 2022
007d0ed
fix: fix macos build
andycall Jul 27, 2022
63837c2
revert test data
suyulin Jul 27, 2022
bdf14d7
Merge branch 'feat/flutter-3' of https://github.com/openwebf/webf int…
suyulin Jul 27, 2022
297a906
fix integration_tests
suyulin Jul 27, 2022
4bd0770
fix: fix macos links
andycall Jul 27, 2022
69baca8
fix: fix linux build
andycall Jul 27, 2022
14fb079
fix: fix bom specs.
andycall Jul 27, 2022
bc4c548
fix: fix bridge unit test ci
andycall Jul 27, 2022
33f13a3
fix: fix linux build
andycall Jul 28, 2022
5f52b79
fix: fix android java code
andycall Jul 28, 2022
66ffb90
fix: fix android build.
andycall Jul 28, 2022
5f1e8f4
chore: adjust image snapshot match ratio.
andycall Jul 28, 2022
427e242
Merge branch 'feat/flutter-3' of github.com:openwebf/webf into feat/f…
andycall Jul 28, 2022
5c56c5f
fix: fix ios build.
andycall Jul 29, 2022
d76330b
fix: fix linux build
andycall Jul 29, 2022
05c0c7d
fix: fix bridge unit test
andycall Jul 29, 2022
adaf8d6
fix: fix wifi connectivity.
andycall Jul 30, 2022
4862f54
feat: use another image match algorithm
andycall Jul 30, 2022
c080288
fix: fix image fit snapshots.
andycall Jul 30, 2022
db6f158
fix: fix textarea spec
devjiangzhou Aug 2, 2022
3d4ec5f
fix: replace span snapshot
devjiangzhou Aug 2, 2022
e97dea4
fix: fix lint
devjiangzhou Aug 2, 2022
2e6cd72
fix: fix widget element dispose cause child not deactivate.
andycall Aug 2, 2022
355d11e
Merge branch 'feat/flutter-3' of github.com:openwebf/webf into feat/f…
andycall Aug 2, 2022
93216e3
fix: fix lint
devjiangzhou Aug 2, 2022
d6080fa
fix: fix input layout error.
andycall Aug 2, 2022
338e751
Merge branch 'feat/flutter-3' of github.com:openwebf/webf into feat/f…
andycall Aug 2, 2022
7418fe3
fix: fix linux build
andycall Aug 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/code_linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
inplace: True
- uses: EndBug/add-and-commit@v4
with:
author_name: openkraken-bot
author_email: [email protected].com
author_name: openwebf-bot
author_email: openwebf@openwebf.com
message: 'Committing clang-format changes'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/example_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
env:
nodeVersion: "16"
cmakeVersion: "3.22.x"
flutterVersion: "2.8.1"
flutterVersion: "3.0.4"

jobs:
build_android-app_in_macos:
Expand All @@ -35,7 +35,7 @@ jobs:

- name: android app build
run: |
cd kraken/
cd webf/
flutter pub get
cd example/
flutter build apk --release
Expand All @@ -60,7 +60,7 @@ jobs:

- name: ios app build
run: |
cd kraken/
cd webf/
flutter pub get
cd example/
flutter build ios --release --no-codesign
Expand All @@ -86,7 +86,7 @@ jobs:

- name: macos app build
run: |
cd kraken/
cd webf/
flutter pub get
cd example/
flutter build macos --release
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
- run: flutter doctor -v
- name: linux app build
run: |
cd kraken/
cd webf/
flutter pub get
cd example/
flutter build linux --release
36 changes: 31 additions & 5 deletions .github/workflows/integration_test_flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on: [workflow_dispatch, pull_request]
env:
nodeVersion: "16"
cmakeVersion: "3.22.x"
flutterVersion: "2.8.1"
flutterVersion: "3.0.4"

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
setup:
runs-on: macos-latest
runs-on: macos-12
outputs:
matrix: ${{ steps.matrix.outputs.value }}
steps:
Expand All @@ -20,7 +20,7 @@ jobs:
JSON=$(node -e "console.log(JSON.stringify(require('./integration_tests/spec_group.json').map(j=>j.name)))")
echo "::set-output name=value::$(echo $JSON)"
build_bridge:
runs-on: macos-latest
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
Expand All @@ -35,8 +35,34 @@ jobs:
with:
name: macos_bridge_binary
path: bridge/build/macos/

bridge_unit_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ env.nodeVersion }}
- uses: jwlawson/[email protected]
with:
cmake-version: ${{ env.cmakeVersion }}
- run: npm i
- run: ENABLE_ASAN=true npm run build:bridge:linux
- run: node scripts/run_bridge_unit_test.js

webf_unit_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.flutterVersion }}
- run: flutter config --enable-macos-desktop
- run: flutter doctor -v
- run: cd webf && flutter test

integration_test:
runs-on: macos-latest
runs-on: macos-12
needs: [ setup, build_bridge ]
strategy:
fail-fast: false
Expand Down Expand Up @@ -69,7 +95,7 @@ jobs:
if: steps.test.outcome != 'success'
run: exit 1
plugin_test:
runs-on: macos-latest
runs-on: macos-12
needs: [ build_bridge ]
steps:
- uses: actions/checkout@v2
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/publish_to_dart_dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Kraken To pub.dev
name: Publish WebF To pub.dev

on:
release:
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
name: ios_binary
path: bridge/build/ios/
build_android_binary:
runs-on: ubuntu-latest
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
Expand Down Expand Up @@ -99,8 +99,6 @@ jobs:
flutter-version: ${{ env.flutterVersion }}
- name: NPM INSTALL
run: npm install
- name: Set up nightly version
run: node scripts/set_up_nightly_release.js
- uses: actions/download-artifact@v2
with:
name: linux_binary
Expand All @@ -118,13 +116,13 @@ jobs:
name: android_binary
path: bridge/build/android/
- name: Prepare distribute binaries
run: node scripts/pre_publish_kraken.js
run: node scripts/pre_publish_webf.js
- name: Publish
uses: k-paxian/dart-package-publisher@master
with:
credentialJson: ${{ secrets.CREDENTIAL_JSON }}
force: true
flutter: true
skipTests: true
relativePath: ./kraken
relativePath: ./webf

2 changes: 1 addition & 1 deletion .github/workflows/publish_to_dart_dev_nightly.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Kraken To pub.dev Nightly
name: Publish WebF To pub.dev Nightly

on:
schedule:
Expand Down
22 changes: 0 additions & 22 deletions .github/workflows/sync_to_release.yml

This file was deleted.

18 changes: 9 additions & 9 deletions bridge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ execute_process(
)
string(REGEX REPLACE "\n$" "" DART_SDK "${DART_SDK}")

list(APPEND KRAKEN_PUBLIC_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/include/kraken_bridge.h
list(APPEND WEBF_PUBLIC_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/include/webf_bridge.h
)

set(QUICKJS_PUBLIC_HEADERS
Expand Down Expand Up @@ -81,9 +81,9 @@ if (DEFINED PLATFORM)
endif()

list(APPEND BRIDGE_SOURCE
kraken_bridge.cc
${CMAKE_CURRENT_SOURCE_DIR}/include/kraken_bridge.h
${CMAKE_CURRENT_SOURCE_DIR}/include/kraken_foundation.h
webf_bridge.cc
${CMAKE_CURRENT_SOURCE_DIR}/include/webf_bridge.h
${CMAKE_CURRENT_SOURCE_DIR}/include/webf_foundation.h
${CMAKE_CURRENT_SOURCE_DIR}/include/dart_methods.h
foundation/logging.cc
foundation/logging.h
Expand Down Expand Up @@ -152,7 +152,7 @@ list(APPEND BRIDGE_INCLUDE
set(BINDING_DIR ${CMAKE_CURRENT_LIST_DIR}/bindings)

if ($ENV{WEBF_JS_ENGINE} MATCHES "quickjs")
add_compile_options(-DKRAKEN_QUICK_JS_ENGINE=1)
add_compile_options(-DWEBF_QUICK_JS_ENGINE=1)

execute_process(
COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/third_party/quickjs/VERSION
Expand Down Expand Up @@ -296,7 +296,7 @@ if ($ENV{WEBF_JS_ENGINE} MATCHES "quickjs")
endif ()

list(APPEND PUBLIC_HEADER
include/kraken_bridge.h
include/webf_bridge.h
)

add_library(webf SHARED ${BRIDGE_SOURCE})
Expand Down Expand Up @@ -335,7 +335,7 @@ if ($ENV{WEBF_JS_ENGINE} MATCHES "quickjs")
endif ()
endif ()

### KrakenStatic
### webfStatic
target_include_directories(webf_static PRIVATE
${BRIDGE_INCLUDE}
${CMAKE_CURRENT_SOURCE_DIR} PUBLIC ./include)
Expand Down Expand Up @@ -389,7 +389,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "iOS")
MACOSX_FRAMEWORK_IDENTIFIER com.openwebf.webf-bridge
MACOSX_FRAMEWORK_BUNDLE_VERSION 1.0
MACOSX_FRAMEWORK_SHORT_VERSION_STRING 1.0
PUBLIC_HEADER ${KRAKEN_PUBLIC_HEADERS}
PUBLIC_HEADER ${WEBF_PUBLIC_HEADERS}
)

# If quickjs is static, there will be no quickjs.framework any more.
Expand Down
7 changes: 4 additions & 3 deletions bridge/bindings/qjs/bom/blob.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/*
* Copyright (C) 2021-present The Kraken authors. All rights reserved.
* Copyright (C) 2019-2022 The Kraken authors. All rights reserved.
* Copyright (C) 2022-present The WebF authors. All rights reserved.
*/

#include "blob.h"
#include "dart_methods.h"

namespace kraken::binding::qjs {
namespace webf::binding::qjs {

std::once_flag kBlobInitOnceFlag;

Expand Down Expand Up @@ -277,4 +278,4 @@ int32_t BlobInstance::size() {
uint8_t* BlobInstance::bytes() {
return _data.data();
}
} // namespace kraken::binding::qjs
} // namespace webf::binding::qjs
13 changes: 7 additions & 6 deletions bridge/bindings/qjs/bom/blob.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/*
* Copyright (C) 2021-present The Kraken authors. All rights reserved.
* Copyright (C) 2019-2022 The Kraken authors. All rights reserved.
* Copyright (C) 2022-present The WebF authors. All rights reserved.
*/

#ifndef KRAKENBRIDGE_BLOB_H
#define KRAKENBRIDGE_BLOB_H
#ifndef BRIDGE_BLOB_H
#define BRIDGE_BLOB_H

#include "bindings/qjs/host_class.h"

namespace kraken::binding::qjs {
namespace webf::binding::qjs {

class BlobBuilder;
class BlobInstance;
Expand Down Expand Up @@ -73,6 +74,6 @@ class BlobBuilder {
std::vector<uint8_t> _data;
};

} // namespace kraken::binding::qjs
} // namespace webf::binding::qjs

#endif // KRAKENBRIDGE_BLOB_H
#endif // BRIDGE_BLOB_H
9 changes: 5 additions & 4 deletions bridge/bindings/qjs/bom/console.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/*
* Copyright (C) 2021-present The Kraken authors. All rights reserved.
* Copyright (C) 2019-2022 The Kraken authors. All rights reserved.
* Copyright (C) 2022-present The WebF authors. All rights reserved.
*/

#include "console.h"
#include "foundation/logging.h"

namespace kraken::binding::qjs {
namespace webf::binding::qjs {

JSValue print(JSContext* ctx, JSValueConst this_val, int argc, JSValueConst* argv) {
std::stringstream stream;
Expand All @@ -31,7 +32,7 @@ JSValue print(JSContext* ctx, JSValueConst this_val, int argc, JSValueConst* arg
}

void bindConsole(ExecutionContext* context) {
QJS_GLOBAL_BINDING_FUNCTION(context, print, "__kraken_print__", 2);
QJS_GLOBAL_BINDING_FUNCTION(context, print, "__webf_print__", 2);
}

} // namespace kraken::binding::qjs
} // namespace webf::binding::qjs
11 changes: 6 additions & 5 deletions bridge/bindings/qjs/bom/console.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
/*
* Copyright (C) 2021-present The Kraken authors. All rights reserved.
* Copyright (C) 2019-2022 The Kraken authors. All rights reserved.
* Copyright (C) 2022-present The WebF authors. All rights reserved.
*/

#ifndef KRAKENBRIDGE_CONSOLE_H
#define KRAKENBRIDGE_CONSOLE_H
#ifndef BRIDGE_CONSOLE_H
#define BRIDGE_CONSOLE_H

#include "bindings/qjs/executing_context.h"

namespace kraken::binding::qjs {
namespace webf::binding::qjs {

void bindConsole(ExecutionContext* context);

}

#endif // KRAKENBRIDGE_CONSOLE_H
#endif // BRIDGE_CONSOLE_H
15 changes: 8 additions & 7 deletions bridge/bindings/qjs/bom/console_test.cc
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
/*
* Copyright (C) 2021-present The Kraken authors. All rights reserved.
* Copyright (C) 2019-2022 The Kraken authors. All rights reserved.
* Copyright (C) 2022-present The WebF authors. All rights reserved.
*/

#include "console.h"
#include "gtest/gtest.h"
#include "kraken_test_env.h"
#include "page.h"
#include "webf_test_env.h"

std::once_flag kGlobalClassIdFlag;

TEST(Console, rawPrintShouldWork) {
static bool logExecuted = false;
kraken::KrakenPage::consoleMessageHandler = [](void* ctx, const std::string& message, int logLevel) {
webf::WebFPage::consoleMessageHandler = [](void* ctx, const std::string& message, int logLevel) {
logExecuted = true;
EXPECT_STREQ(message.c_str(), "1234");
};
auto bridge = TEST_init();
const char* code = "__kraken_print__('1234', 'info')";
const char* code = "__webf_print__('1234', 'info')";
bridge->evaluateScript(code, strlen(code), "vm://", 0);
EXPECT_EQ(logExecuted, true);
}

TEST(Console, log) {
static bool logExecuted = false;
kraken::KrakenPage::consoleMessageHandler = [](void* ctx, const std::string& message, int logLevel) {
KRAKEN_LOG(VERBOSE) << message;
webf::WebFPage::consoleMessageHandler = [](void* ctx, const std::string& message, int logLevel) {
WEBF_LOG(VERBOSE) << message;
logExecuted = true;
};
auto bridge = TEST_init([](int32_t contextId, const char* errmsg) {
KRAKEN_LOG(VERBOSE) << errmsg;
WEBF_LOG(VERBOSE) << errmsg;
exit(1);
});
const char* code = "console.log(1234);";
Expand Down
Loading